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
Post a Comment