I'm trying to change multiple file names with a for loop.
This works to send the output to the screen:
for i in *.gz; do echo $i | sed 's/\-//g'; done
However, when I try to overwrite the file name using sed -i, I get this error:
for i in *.gz; do echo $i | sed -i 's/\-//g'; done
sed: no input files
Any suggestions?
-character from the names of your .gz files? How are you usingsed -i? Include that code in your question so that it is clear. See this related post: Batch renaming files on Unix & Linux.