I have 10 folders that I want to loop through while executing the following command:
awk 'FNR > 1' *.csv | sort -sk 1,2 | sort -sk 3,3 > ${f}_appended.dat
With a for loop wrapper, like this:
for f in */ ; do awk 'FNR > 1' *.csv | sort -sk 1,2 | sort -sk 3,3 > ${f}_appended.dat; done
It only writes _appended.dat
in each folder and does not perform the command on files in the folder it is looping through, but rather the root folder (if there are any).
DESIRED OUTCOME:
Have an _appended.dat file in each folder that was generated with the awk command. So 10 folders with a unique file generated based on the contents of .csv files in each folder.