Bash
Useful bash commands
1
# for loop
2
[email protected] ~ $ for num in {1..4}; do echo "The number is: $num"; done
3
The number is: 1
4
The number is: 2
5
The number is: 3
6
The number is: 4
# for loop combining awk
[email protected] ~ $ for subd in $(awk '{print $1 ""}' subdomains.txt); do echo $subd; done
blog.techwithtyler.dev
braindump.techwithtyler.dev
techwithtyler.dev
www.techwithtyler.dev
# original file
[email protected] ~ $ cat subdomains.txt
blog.techwithtyler.dev 234234234
braindump.techwithtyler.dev 25346536
techwithtyler.dev 43564356743
www.techwithtyler.dev 45776568
Last modified 3mo ago