Created
January 15, 2013 01:38
-
-
Save PabloVallejo/4535279 to your computer and use it in GitHub Desktop.
Shell loops
This file contains 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
#!/bin/bash | |
# Basic For Loop | |
for file in ${_BadMaps[*]} | |
do | |
echo "$file" | |
end | |
#!/bin/bash | |
# For loop with validation | |
# Make sure the folder exists! | |
if [ -d _BadMaps ] ; then | |
echo "Good!" | |
else | |
echo "JESUS NNOO!!!!!!" | |
exit 1 | |
fi | |
# Make sure there is at least one file in there | |
if [ -f _BadMaps/DM-MetalHell.ut2 ] ; then | |
echo "Good!" | |
else | |
echo "GOD NNOO!!!!!!" | |
exit 1 | |
fi | |
# Echo out all files in directory! | |
for file in _BadMaps/*.ut2 ; do | |
echo "$file" | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment