Skip to content

Instantly share code, notes, and snippets.

@batako
Created September 11, 2012 08:41
Show Gist options
  • Save batako/3696959 to your computer and use it in GitHub Desktop.
Save batako/3696959 to your computer and use it in GitHub Desktop.
指定したディレクトリ内の全ファイル名を取得する
# 指定ディレクトリの最後の「/」は省略可能
DIRECTORY_PATH="/Users/batako/Download/"
for FILE_PATH in `echo $DIRECTORY_PATH/ | sed -e "s/\/\//\//g"`*
do
echo ${FILE_PATH##*/}
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment