|
|
Alternate Method
Here's an alternate script that gets rid of space in file names.
cd to the folder with files you want to change then run this script.
If you'd prefer to make spaces an underscore, swap the comment lines.
#! /bin/sh for n in * do OldName=$n NewName=`echo $n | tr -d " "` #NewName=`echo $n | tr -s " " "_"` echo $NewName mv "$OldName" "$NewName" done
Run this script anywhere?
I'd love to use this, but first I must clear up a more basic mystery [to me; I bet most of you know this]: how can I make it so that my script will run even if I'm not the folder that has the script? There is a way to define a "path" or two in *nix, as in DOS, but I don't know how it's done in *nix or OSX. Can some one point me to a hint for that?
What does the first line mean?
By the way, what does the line beginning with "#! ..." mean? |
SearchFrom our Sponsor...Latest Mountain Lion HintsWhat's New:HintsNo new hintsComments last 2 daysLinks last 2 weeksNo recent new linksWhat's New in the Forums?
Hints by TopicNews from Macworld
From Our Sponsors |
|
Copyright © 2014 IDG Consumer & SMB (Privacy Policy) Contact Us All trademarks and copyrights on this page are owned by their respective owners. |
Visit other IDG sites: |
|
|
|
Created this page in 0.18 seconds |
|