Last active
January 9, 2019 13:02
-
-
Save maneta/3bed2af0890f5ca13f5017c725c9dd5a to your computer and use it in GitHub Desktop.
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 | |
#Creating the five directory | |
mkdir ./five | |
for counter in {1..5} | |
do | |
#Creates the dir1..dir5 directories | |
mkdir ./five/dir$counter | |
for files in {1..4} | |
do | |
#Creates the files inside de dir1..dir5 dirs | |
touch ./five/dir$counter/file$files.txt | |
#BLACK MAGIC ALERT: using the comand seq to iterate over sequence of number | |
#More info on stack overflow: https://stackoverflow.com/questions/169511/how-do-i-iterate-over-a-range-of-numbers-defined-by-variables-in-bash | |
for echo in $(seq 1 $files) | |
do | |
echo "$files" >> ./five/dir$counter/file$files.txt | |
done | |
done | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment