Hello,
I want to rename more than 100 files. These files have "?" in there existing file name but I want to rename files to there first part before "?" token. I have tried using for loop but it isn't working so help following is the sample filename and for loop that am trying to use:
example of file name: abcde?fghijk
Expected file name:abcde
For Loop:
for i in $( ls * ) ; do echo $i; echo "$( echo $i | sed -e 's/?.*//g' )"; done
am I missing something in above loop or is there a better way to deal with this?
Please help!