I never use it either, I was just curious.  My boss had been using it in
his scripts and when I had him take it out, his scripts stopped working.


I think Raymondo answered my question, explaining that it simply acts as
a new line when you use the syntax:

if [ test ] ; then

rather than 

if [ test ] 
then 

Dave

-----Original Message-----
From: R P Herrold [mailto:[EMAIL PROTECTED]] 
Sent: Wednesday, February 05, 2003 12:11 PM
To: [EMAIL PROTECTED]
Subject: RE: Bash script help ?


On Wed, 5 Feb 2003, David Simmons wrote:

> I have noticed in this thread that everyone is putting a ";" after 
> their
> tests:  if [ test ] ; and for [ test ] ; 
> 
> When is the ";" required or is it always required after the test in a 
> conditional statement?

Ehhh?  Not all people do.  I never do:

[herrold@ftp bin]$ grep [[] ORC*
ORCcodingStd:   [ -e /etc/PUID ] && head -1 /etc/PUID | awk {'print $2'}

ORCcodingStd:[ -e /etc/ORC/config ] && {
ORCcodingStd:[ -e /etc/ORC/siteoptions ] && . /etc/ORC/siteoptions
ORCcodingStd:#  [ -e $PROGPID ] && rm $PROGPID ORCcodingStd:[ -f
/tmp/ORCdebug ] && { ORCcodingStd:[ "x$1" = "x-d" ] && {

The multiline && construct looks like:

[ "x$1" = "x-d" ] && {
        echo "arg one is and option $1 for debugging"
        DEBUG="y"
        export DEBUG
        }

see also our presentation outline notes at:
    http://www.colug.net/notes/0012mtg/COLUG-0012.html

- Russ Herrold

-- 
end
======================================+
 .-- -... ---.. ... -.- -.--          |
 Copyright (C) 2003 R P Herrold       | Owl River Company
 [EMAIL PROTECTED]  NIC: RPH5 (US) | "The World is Open to Linux
(tm)"
   My words are not deathless prose,  | Open Source LINUX solutions ...
      but they are mine.              | [EMAIL PROTECTED] -- Columbus,
OH
 gpg --keyserver pgp.mit.edu --recv-key 0x7BFB98B9 
 gpg --list-keys 2> /dev/null | grep 7BFB98B9



-- 
redhat-list mailing list
unsubscribe mailto:[EMAIL PROTECTED]?subject=unsubscribe
https://listman.redhat.com/mailman/listinfo/redhat-list



-- 
redhat-list mailing list
unsubscribe mailto:[EMAIL PROTECTED]?subject=unsubscribe
https://listman.redhat.com/mailman/listinfo/redhat-list

Reply via email to