Skip to content

Instantly share code, notes, and snippets.

@shnhrtkyk
Last active July 9, 2019 00:29
Show Gist options
  • Save shnhrtkyk/8f8dd28d76a9f3f972913aff10189bd7 to your computer and use it in GitHub Desktop.
Save shnhrtkyk/8f8dd28d76a9f3f972913aff10189bd7 to your computer and use it in GitHub Desktop.
ディレクトリ内のファイルを引数を渡してpythonで処理する
#!/bin/sh
dir_path="/path/*"
dirs=`find $dir_path -maxdepth 2 -type f -name *.txt`
for dir in $dirs;
do
echo $dir
echo ${dir%.*}.npz
# ここから実行処理を記述
python /path/to/script/convert.py $dir ${dir%.*}.npz ${dir%.*}_
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment