Last active
August 16, 2016 03:19
-
-
Save piaoger/f4d6f6fac2d38557511bb4f70564421e to your computer and use it in GitHub Desktop.
list *.js files and child directories
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# list *.js files in directory | |
for file in ./*.js | |
do | |
if [[ -f $file ]]; then | |
echo $file | |
fi | |
done | |
# list child dirs except hidden ones | |
dirs=$(find . -mindepth 1 -maxdepth 1 -type d \( ! -iname ".*" \) | sed 's|^\./||g') | |
for dir in $dirs | |
do | |
if [[ -d $dir ]]; then | |
#copy stuff .... | |
echo $dir | |
fi | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment