linuxjournal.com — fter using the mv command all too many times and typing things like mv FILE.TXT file.txt, I wrote this script. I was thinking I could put a new coat of paint on it but, in reality, it does the job and is easy to understand. (The line numbers are there, of course, just for reference.)
Jul 26, 2008 View in Crawl 4
wattersmJul 27, 2008
What does the OS have to do with renaming files? Bash runs on BSD too, it's the first port I install every time.
mtheoryxJul 27, 2008
* just use powershell and be NEARLY AS cool AS *nixFixed for ya.
kahrnJul 27, 2008
While I don't think this particular script should have made the front page I'm gonna digg it up anyways. Why? Because it reminds me of what digg used to be like. Seriously, all the new areas of digg and all this politics crap and all the rest of it has ruined it. True -- it has brought some interesting news but nothing as interesting as the tech related stuff like this we used to get on digg. You can read your politics and all that stuff anywhere you want. Perhaps its time to ask if we can have the old digg back.
mr_mechanicsJul 28, 2008
You can check if it is a directory using the -d flag, then send it back to the script using $0:if [ -d "$x" ]then$0 "$x"fi
paulishJul 28, 2008
I dugg it only so tech stuff would hit front page. Much better to have this than a lolcat.
eir574Jul 28, 2008
@trogodor,Or, at least anyone who didn't know how to do this but who's truly interested in becoming competent at the *NIX command line would take 60 seconds to google the problem and come up with a solution. It's still faster than installing a third party application, and you actually learn something.
fas2Jul 28, 2008
@LeviTheSmith: No description of 'y' in the rename manual found.Thanks, matx and glinsvad.
doxxAug 4, 2008
Because Linux people on a whole tend to act like newbie idiots?