I have bunch of sub-folders following the naming pattern x1, x2, x3, x4 ... and each containing the same script.sh file. What if I want to write a script, that changes certain line (say line 2) of that script file from x1 to whatever the folder's name is?
So for example, in folder x5, the 2nd line of script.sh should be x5, and in folder x39, the second line of script.sh should be x39.
Thanks!