Skip to content

Instantly share code, notes, and snippets.

@yuba
Last active April 20, 2018 14:33
Show Gist options
  • Save yuba/d3500285422f539c8ada5292400593d1 to your computer and use it in GitHub Desktop.
Save yuba/d3500285422f539c8ada5292400593d1 to your computer and use it in GitHub Desktop.
ディレクトリ内のすべてのファイルをループする ref: https://qiita.com/yuba/items/489fadb350246b5c94e7
while read -d $'\0' file; do
"${file}" に対して処理
done < <(find ディレクトリ -mindepth 1 -maxdepth 1 -print0)
while read file; do
"ディレクトリ/${file}" に対して処理
done < <(ls -A -1 ディレクトリ)
while read -d $'\0' file; do
"${file}" に対して処理
done < <(find ディレクトリ -mindepth 1 -maxdepth 1 -print0)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment