[Ilugc] test -a

  • From: Anthony.Ashok@xxxxxxxxxxxxxxx (Anthony Ashok)
  • Date: Fri Mar 4 15:30:21 2005

I understand that test -a is used to combine the operator. I mean It is 
eauvalent to logivcal operator "&"

But in some of the source codes I find that

DIR="/home/user/file"

if   test  ! -a $DIR


what is the use of -a here

I want to know about that

with warm regards,
Anthony Jesu Ashok S Ext : 7257




"Muthukumar" <ramana_muthu@xxxxxxxxxxx>
03/04/2005 02:46 PM

 
        To:     "Anthony Ashok" <Anthony.Ashok@xxxxxxxxxxxxxxx>
        cc:     <ilugc@xxxxxxxxxxxxx>
        Subject:        Re: [Ilugc] Re: ilugc Digest, Vol 10, Issue 13



Please explain the use of "-a" there

Plz. when ever you start a thead then use appropriate subject to that.

To explain the usage of -a in test command,

/tmp/tst is a file
/tmp/tst.log is a file

Checking as,

# test -f /tmp/tst -a -f /tmp/tst.log
# echo $?
# 0

# test -f /tmp/nofile
# echo $?
# 1

-a is used to combine to test operationgs. -o is used for OR operation. -a 
is having more precedence than -o

HTH.

Thanks,
-Muthukumar.




______________________________________________________________________




______________________________________________________________________

Other related posts: