I am trying to create a program that will create a new text file for each iteration of a number ie passing in a parameter 3 and setting num=3 should create text.txt and the end result should have text3.txt, text2.txt, and text1.txt. I know that I need to use the touch command to create a new file, but I am unable to figure out how to change that specific variable when I create it.
Asked
Active
Viewed 31 times
0
-
Similar questions have been answered countless times here on SO. For example: https://stackoverflow.com/questions/13638670/adding-counter-in-shell-script – StFS Oct 31 '17 at 23:44
-
Note that you don't want the accepted answer on the dupe (which is only good with constant values) but the runner-up. – Charles Duffy Oct 31 '17 at 23:47
-
Thank you so much! – Charlie Yeng Oct 31 '17 at 23:53