Quote:
Originally Posted by freizl
Assuming the "ABC20090102" string is fixed length.
And I'm using sh shell.
Code:
ls -1 *.txt | awk '{print "mv", $1, substr($1,12) }' | sh
|
it is also not necessary to use ls and sh , by making use of FILENAME variable
Code:
awk '{ system("mv " FILENAME" " substr(FILENAME,1,12) )}' ABC*.txt
not tested.