Skip to content

Instantly share code, notes, and snippets.

@nobucshirai
Last active August 29, 2015 13:58
Show Gist options
  • Save nobucshirai/9974351 to your computer and use it in GitHub Desktop.
Save nobucshirai/9974351 to your computer and use it in GitHub Desktop.
#!/bin/bash
DIR="JOB_OUTPUT"
main(){
ifdne_mkdir
for file in `ls`; do
err_count=`echo $file | grep -c "sh\.e"`
out_count=`echo $file | grep -c "sh\.o"`
if [[ $err_count > 0 || $out_count > 0 ]]; then
mv $file $DIR
fi
done
}
ifdne_mkdir(){
if [ ! -d "$DIR" ];then
mkdir $DIR
fi
}
main $@
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment