Last active
March 9, 2017 19:30
-
-
Save var-bin/aaf2f878cc0eec04d5618207ba1dd6ad to your computer and use it in GitHub Desktop.
for in in bash, example. Repository https://github.com/var-bin/terminalForCoder__WSD
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 | |
for i in 1 2 3 4 5 | |
do | |
file_name="file${i}.txt" | |
if [[ -e "$file_name" ]] | |
then | |
continue | |
fi | |
echo "Creating file ${file_name}" | |
touch "$file_name" | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment