From: "Drew Cohan" <[EMAIL PROTECTED]>
Reply-To: <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
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 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.

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 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 really should take a shell scripting class. :)

Thanks,

Drew Cohan
[EMAIL PROTECTED]





--
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

_________________________________________________________________
The new MSN 8: advanced junk mail protection and 2 months FREE* http://join.msn.com/?page=features/junkmail


--
To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to