Re[2]: [Cumbria] Re: The Guy has a point

Ian Linwood cumbria at mailman.lug.org.uk
Fri Jan 17 18:42:01 2003


Hello Ken,

Friday, January 17, 2003, 9:15:07 AM, you wrote:

> && allows the two commands to be written on the same line.

Actually its a semicolon that does that, ie. command1 ; command2

The && is an AND operator. Given the example;

    command1 && command2

If command1 is successful, then command2 is carried out.  If command1
fails command2 is NOT carried out.

Example
-------

$ pwd
/export/home/ian
$ cd / ; ls
bin         dev         export      lib         net         proc        usr         xfn
cdrom       devices     home        lost+found  opt         sbin        var
data        etc         kernel      mnt         platform    tmp         vol
$ pwd
/
$ cd 
$ pwd
/export/home/ian
$ cd /nonexistant && ls
/nonexistant: does not exist
$ pwd
/export/home/ian



-- 
Best regards,
 Ian                            mailto:ian@darksideofthemoon.org.uk