bash - How do I remove a character from a string in a Unix shell script? -


i have several files named this: file - name.txt

how remove " - " using bash script in unix files?

use parameter expansion remove part of string want rid of. make sure use double-quotes prevent mv misinterpreting input.

for in ./*' - '*;     mv "$i" "${i// - }" done 

Comments

Popular posts from this blog

java.util.scanner - How to read and add only numbers to array from a text file -

rewrite - Trouble with Wordpress multiple custom querystrings -