Re: Scripting
From: Thomas Adam (thomas_adam16_at_yahoo.com)
Date: 11/07/04
- Previous message: Silvan Villiger: "Scripting"
- In reply to: Silvan Villiger: "Scripting"
- Next in thread: Ron Johnson: "Re: Scripting"
- Reply: Ron Johnson: "Re: Scripting"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Sat, 6 Nov 2004 23:10:56 +0000 (GMT) To: Silvan Villiger <vsilvan@stud.phys.ethz.ch>, debian-user@lists.debian.org
--- Silvan Villiger <vsilvan@stud.phys.ethz.ch> wrote:
> I've started to learn scripting in linux. But I have some troubles
> understandig the redirection of the streams. I tried to test whether a
> directory already exists using the ls command (didn't find a bether
> solution) and whenever ls doesn't find such a directory it writes an
[ -d /some/directory ] && echo "directory exists" >&2 || echo "nope. does
not exist" >&2
Which will echo the reply to stderr.
> Another example I had, was when I tried to compile a latex-file in a
> script. How can i prevent it from writing compiling-informations to the
> shell which started the script?
thescript 2> /dev/null
would redirect all errors to the bit-bucket. If you wanted to blank the
entire lot:
thescript > /dev/null 2>&1
(or, if you don't care for portability, the command above is the same as:
thescript &> /dev/null )
HTH,
-- Thomas Adam
=====
"The Linux Weekend Mechanic" -- http://linuxgazette.net
"TAG Editor" -- http://linuxgazette.net
"<shrug> We'll just save up your sins, Thomas, and punish
you for all of them at once when you get better. The
experience will probably kill you. :)"
-- Benjamin A. Okopnik (Linux Gazette Technical Editor)
___________________________________________________________ALL-NEW Yahoo! Messenger - all new features - even more fun! http://uk.messenger.yahoo.com
-- To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
- Previous message: Silvan Villiger: "Scripting"
- In reply to: Silvan Villiger: "Scripting"
- Next in thread: Ron Johnson: "Re: Scripting"
- Reply: Ron Johnson: "Re: Scripting"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|