Hello!
My name is Mark and this is my second post to Linux Questions. I am not an utter newbie to the Unix command-line, however I've never really done anything more sophisticated than moving and copying files, and moving and copying folders. Recently at work, I wanted to perform batch conversion of a long list of files from one file extension type to another.
I searched the web and found this link (
http://lab.artlung.com/unix-batch-file-rename/). I had to go about halfway down the page to find information that finally helped me; much of what was posted there didn't work on my system. Specifically, here is the text from the link that ultimately helped me.
>In general, if you want to add a suffix to your files, do this (.txt in this example):
>
>ls
>file1 file2 file3
>
>for i in *; do mv $i $i.txt; done
>
>ls
>file1.txt file2.txt file3.txt
>
>If you want to take it back off (.txt in this example again)
>
>for i in *.txt; do mv $i ${i%.*}; done
>
>ls
>file1 file2 file3
I would like to learn more about this but have no idea how to search for more information. Here is my question. What is this text (for i in *; do mv $i $i.txt; done) and this text (for i in *.txt; do mv $i ${i%.*}; done) called? In other words, when I type that text into the command-line, what is the name of the activity I am performing? Is it called shell scripting? Programming? Mucking about? The sequence of commands in those two texts reduced a job that would have taken hours manually into a nearly instantaneous process and I would really like to learn more about that.
Thank you for your help!
Mark
P.S. It would be great if you could recommend books or other reference materials I should seek out. In other words I would like to RTFM but I don't know what FM to R.