Solved

IF..THEN..ELIF conditions

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

Ine of the conditions says:

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

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

Its Korn Shell on AIX
0
Comment
Question by:stummj
3 Comments
 
LVL 45

Accepted Solution

by:
sunnycoder earned 500 total points
ID: 22634026
Hello stummj,

http://www.cs.princeton.edu/~jlk/kornshell/doc/man93.html#Conditional%20Expressions
-a file
    Same as -e below. This is obsolete.
...
-e file
    True, if file  exists.


Regards,

sunnycoder
0
 
LVL 84

Expert Comment

by:ozo
ID: 22634041
man ksh
man test
0
 

Author Closing Comment

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

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