Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Shell script if and if are true

Status
Not open for further replies.

njdnjd

MIS
Jan 21, 2002
8
US
Hello scripters,
I am trying to write a shell script that calls another script when a file is not in either location. Ex...
if [[ ! -f "/myfile"]] and
if [[ ! -f "/nextfile"]] then
call2
fi


I can get it to work if one line is true but not when two are true. What is the correct syntax? Thanks in advance.....:-D
 
if [ ! -f "/myfile" -a ! -f "/nextfile"] ; then vlad
+----------------------------+
| #include<disclaimer.h> |
+----------------------------+
 
Hi:

another way of doing/saying the same thing:

# all one line
[ ! -f &quot;/home/eds/myfile&quot; ] &&
[ ! -f&quot;/home/eds/nextfile&quot; ] && call2
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top