IF..THEN..ELIF conditions

Posted on 2008-10-03
Last Modified: 2013-12-26
I have inherited some code that I need to understand.

Ine of the conditions says:

if [ condition ]
elfif [condition -a condition ]
 ... something else ...

I assume the -a means logical AND but I cant see that documented anywhere.
Can anyone confirm that please?

Its Korn Shell on AIX
Question by:stummj
LVL 45

Accepted Solution

sunnycoder earned 500 total points
ID: 22634026
Hello stummj,
-a file
    Same as -e below. This is obsolete.
-e file
    True, if file  exists.


LVL 84

Expert Comment

ID: 22634041
man ksh
man test

Author Closing Comment

ID: 31502760
Thanks - I'll re-write it to make it clear for whoever comes along after me.

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This Windows batch file is useful for organizing image files from a digital camera or other source, but can have many other uses.  It simply renames the file(s) to match their create date.  For example, if you took a picture today at 1:40pm and the …
Background Still having to process all these year-end "csv" files received from all these sources (including Government entities), sometimes we have the need to examine the contents due to data error, etc... As a "Unix" shop, our only readily …
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
Hi friends,  in this video  I'll show you how new windows 10 user can learn the using of windows 10. Thank you.

912 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

24 Experts available now in Live!

Get 1:1 Help Now