View Single Post
  #8   (View Single Post)  
Old 13th December 2008
sverreh's Avatar
sverreh sverreh is offline
Real Name: Sverre Hval
Port Guard
 
Join Date: Apr 2008
Location: Norway
Posts: 36
Default

Nice little script, robbak!
What if I want to change all "-" to "_" in the filenames? Is there a command for that too in bash?

Quote:
Originally Posted by robbak
Of course this may be a bashisim.
I guess it is. I tried it in Bourne shell:
Code:
$ for filename in *
> do
> mv "$filename" "${filename/-/_}"
> done
${filename/...}: Bad substitution
Reply With Quote