Quote:
Originally Posted by jxh461
I did the following but I am surely missing something.
|
Yes you are...
Code:
bash-3.00# ls
ab_1.csv ab_2.csv ab_3.csv ab_4.csv
bash-3.00# for i in ab_*.csv; do
> echo mv $i ${i#*_}
> done
mv ab_1.csv 1.csv
mv ab_2.csv 2.csv
mv ab_3.csv 3.csv
mv ab_4.csv 4.csv
Check the Parameter Expansion section of the man page of bash/ksh for the explanation.