HELP! Script to RENAME/REMOVE ( ) From File NAMES!!
Hello, I am workign with linux and am looking for a script/command that will remove ( ) parenthesis from a series of file names in a given directory. I have been given various pieces of code but they either done work or return the error "Badly places ( )" which is redundant becuase I know they are badly placed. If ANYONE has a solution your input woudl be greatly appreciated.
Thanks in advance. |
Code:
for FILE in `ls |grep \(` |
How about just a one-liner:
Code:
for i in *\(*\)*; do j=`echo $i |sed -e 's/[()]//g'`; mv "$i" "$j"; done |
Thank You Both Of You.
I tried NFISK approach first simply becuase it was shorter, and it worked like a charm. I have been working on this on and off for a week. I appreciate BOTH your help and thanks again!!!
|
Technically Nfisk's wasn't really a one liner except he separated the commands by semicolon. One could do the same with the one I posted (and leave out the echo which I hadn't meant to include - it was there in my testing).
Anyway glad you got it solved. |
All times are GMT -5. The time now is 05:02 PM. |