Hi Folks,
I am trying to strip away the last five characters from the file name. Following is an example
Input: file1.done
Output: file1
My nawk script is as follows
I am executing the script as follows
How can I execute the move command from within my awk script?
Thanks in advance
rogers
I am trying to strip away the last five characters from the file name. Following is an example
Input: file1.done
Output: file1
My nawk script is as follows
Code:
BEGIN {
# Set the field separator to white space
FS=" "
}
{
print | "mv " $9 " " substr($9, 1,length($9)-5)
}
I am executing the script as follows
Code:
ls -ltrh file* | nawk -f rename_files.awk
How can I execute the move command from within my awk script?
Thanks in advance
rogers