Hi All,
I need to rename multiple files after copying them to a folder from other folder.
I am getting files in this format..
test_20070513.txt, test1_20070513.txt,...
I want to strip the _ & date and I want file names to be as
test.txt, test1.txt,.....
I am trying to do something like this
cp /tmp/target/* /tmp/source/
echo 'files are moved to source folder'
ls -l |tr 's' '_*.txt' '.txt'
echo 'status=0'
exit 0
I tried to use 'sed' command too. I am not able to get what I need.Please help me in building this script...
Thanks in Advance...
I need to rename multiple files after copying them to a folder from other folder.
I am getting files in this format..
test_20070513.txt, test1_20070513.txt,...
I want to strip the _ & date and I want file names to be as
test.txt, test1.txt,.....
I am trying to do something like this
cp /tmp/target/* /tmp/source/
echo 'files are moved to source folder'
ls -l |tr 's' '_*.txt' '.txt'
echo 'status=0'
exit 0
I tried to use 'sed' command too. I am not able to get what I need.Please help me in building this script...
Thanks in Advance...