--- Begin Message ---
Subject: |
Re: bug in the documentation, or ...? |
Date: |
Tue, 14 Feb 2006 16:43:58 -0500 |
%% nusret <address@hidden> writes:
n> I really don't have any experience with Unix(-like)
n> systems. Someone told in some mailing list that if we change ';' to
n> '&&' the change will cause problems in some unix systems. is this
n> true?
No, that's not true.
n> Why do you say && is safer?
If you use this:
cd foo; blahblah
and the directory "foo" does not exist then it will print an error BUT
it will still run the command "blahblah". Consider what happens if
"blahblah" is really a rm command, for example:
cd foo; rm *
Now if foo doesn't exist you'll remove all the files in your current
directory!!
On the other hand, if you use && then the second command only runs if
the first one succeeds, so with:
cd foo && blahblah
the command "blahblah" won't run if the cd fails.
--
-------------------------------------------------------------------------------
Paul D. Smith <address@hidden> Find some GNU make tips at:
http://www.gnu.org http://make.paulandlesley.org
"Please remain calm...I may be mad, but I am a professional." --Mad Scientist
--- End Message ---