[Date Prev][Date Next] [Thread Prev][Thread Next]
[Thread Index]
[Date Index]
[Author Index]
RE: IF statements on the command line in bash
- From: Chad and Doria Skinner <cws-dls swbell net>
- To: redhat-list redhat com
- Subject: RE: IF statements on the command line in bash
- Date: Mon, 01 Oct 2001 10:21:12 -0500
> $ for i in 21 22 23 24 25 26 27 28 29 30 ; echo "Sep $i" ; done
for i in 1 2 3 ; do echo "i is $i" ; done
> $ if [ -x /etc/hosts ] ; echo "File exists." ; done
I doubt you are trying to do the above as -x tests if the files is
eXecutable -e tests for existence.
if [ -e /etc/hosts ] ; then echo "File exists." ; fi
HTH,
Chad
[Date Prev][Date Next] [Thread Prev][Thread Next]
[Thread Index]
[Date Index]
[Author Index]