View Single Post
  #7   (View Single Post)  
Old 13th December 2008
robbak's Avatar
robbak robbak is offline
Real Name: Robert Backhaus
VPN Cryptographer
 
Join Date: May 2008
Location: North Queensland, Australia
Posts: 366
Default

There is also some bash tricks that should be able to do that in one step. Let's see if I can work it out.
Code:
robbak@robbak-PC:~/testdir$ touch file-one
robbak@robbak-PC:~/testdir$ touch file-two
robbak@robbak-PC:~/testdir$ touch file-three
robbak@robbak-PC:~/testdir$ touch "with space-four"
robbak@robbak-PC:~/testdir$ for filename in *; do mv "$filename" "${filename/-/_}"; done
robbak@robbak-PC:~/testdir$ ls
file_one  file_three  file_two  with space_four
robbak@robbak-PC:~/testdir$
Of course this may be a bashisim.
__________________
The only dumb question is a question not asked.
The only dumb answer is an answer not given.
Reply With Quote