We need to write from 000 to 999 in a file. As these are consecutive numbers we will be using "Brace Expansion"
Let's Create a file by using the touch command.
Script:
#create an empty file
touch output.txt#using brace expansion with foor loopfor i in {000..999} #this is brace expansiondo#append data to output.txtecho $i >> output.txtdone
Output:
To see the output use bellow command
cat output.txt | more
No comments:
Post a Comment