Re: quick shell questions
I gotta re read my shell book for this one. I'd recommend UNIX shells by
Example by Ellie Quigley. It's a well written book.
From: "Drew Cohan" <email@example.com>
Subject: quick shell questions
Date: Tue, 10 Dec 2002 13:00:51 -0500
1. How do I combine these two (JPG vs jpg):
for f in /path/to/*.JPG; do mv "$f" `date +%N`.jpg; done
for f in /path/to/*.jpg; do mv "$f" `date +%N`.jpg; done
I believe this is redirecting the standard error(2) to where the standard
output(1) is going. Since standard ouput is redirected to /dev/null, the
standard output will go there too. To make a long story short, they'll both
end at /dev/null which is really nothing. You do this when you generate
messages or return values that you don't need.
I'm trying to avoid duplicate filenames during my renaming sessions.
2. What does the "2>/dev/null>&1" mean that I see in a lot of examples
(eg ls 2>/dev/null/>&1).
I really should take a shell scripting class. :)
To UNSUBSCRIBE, email to firstname.lastname@example.org
with a subject of "unsubscribe". Trouble? Contact
The new MSN 8: advanced junk mail protection and 2 months FREE*