Copyright 2002,2003 A.P. Lawrence
False
It will never produce a listing because it will always exit after the test, which only determines if it echoes "nope" or not.
We use Google third-party advertising companies to serve ads when you visit our website. These companies may use information (not including your name, address, email address, or telephone number) about your visits to this and other websites in order to provide advertisements about goods and services of interest to you. If you would like more information about this practice and to know your choices about not having this information used by these companies, click here.
Tue Aug 8 07:42:18 2006 Ok vinodk
Yes i do think so
Wed Aug 8 07:37:15 2007 anonymous
ergo... inproper indenting is confusing. =)
Fri Feb 29 20:27:50 2008 LarryIrwin
False is correct, but the style is poor...
Here's the way to make it true (with proper indenting, etc.)
#!/bin/sh
[ "$1" = "nope" ] && {
echo "nope"
exit 1
}
ls
Fri Feb 29 20:34:44 2008 TonyLawrence
Well, yes, but that was the point - that you need to bracket this if you
need more than one action.
Wed Jun 24 12:50:20 2009 worwan
or I use following method if I want to execute more commands
[ "$1" = "nope" ] && echo "nope" && exit 1
Wed Jun 24 20:20:11 2009 TonyLawrence
That's not always a good way to do that.
See http://aplawrence.com/Basics/break_out.html
Add your comments