Solved

IF..THEN..ELIF conditions

Posted on 2008-10-03
3
10,124 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
Comment Utility
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
Comment Utility
man ksh
man test
0
 

Author Closing Comment

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

Featured Post

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

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 …
Active Directory replication delay is the cause to many problems.  Here is a super easy script to force Active Directory replication to all sites with by using an elevated PowerShell command prompt, and a tool to verify your changes.
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…
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

763 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

12 Experts available now in Live!

Get 1:1 Help Now