I'm trying to take all files of a certain extension, rename them, apply a script to them, and then rename them again. I'm running into something weird.
For the first step of this, I'm trying to apply the following command
for f in *.FDC; do mv $f ${f%FDC}FDCTMP1 done
Which, I believe, should, for all files of type .FDC, apply the mv function to them, resulting in files renamed as *.FDCTMP1.
When I try to run this, the $ in the command line turns to a >, and I'm unable to do anything. I've run into this problem in the past and I don't really know what's going on. Every time this happens I have to close out my putty instance and start a new one.
The next step is applying my script to the newly renamed .FDCTMP1 files. I'm not quite sure I got this right, but here's what I'm trying:
for f in *.FDCTMP1; do more $f | a bunch of sed and awk stuff here
I was originally testing this script with more filename | sed & awk stuff, and wasn't positive how I would change that functionality to taking each filename in the loop.
then, I want to apply the same idea as in step 1, to rename the filetype again:
for f in *.FDCTMP1; do mv $f ${f%FDCTMP1}FDCTMP2 done
I think I supplied too much info about my problem, I think the main issue is this part:
for f in *.FDC;
If it's relevant, I'm in kornshell