Wrox Programmer Forums
| Search | Today's Posts | Mark Forums Read
BOOK Beginning Linux Programming, 3rd Edition
This is the forum to discuss the Wrox book Beginning Linux Programming, 2nd Edition by Richard Stones, Neil Matthew, Alan Cox; ISBN: 9780764543739
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK Beginning Linux Programming, 3rd Edition section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old April 3rd, 2005, 11:49 AM
Registered User
 
Join Date: Apr 2005
Location: , , .
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Wrong teaching on shell conditions

On page 32 on shell conditions the authors suggest that the trailing ] is also added just for readability. This is wrong and an opening '[' must be followed by a closing one ']'. Following the discussion, a weird example is added:
ls -l /usr/bin [
which makes no sense at all and just produces an error message that the file '[' was not found!
 
Old October 1st, 2005, 06:33 AM
Registered User
 
Join Date: Oct 2005
Location: , , .
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default

this is not wrong. you have an extra space in your command. try it with no space between the slash and bracket:

--- cut ---
# ls -l /usr/bin/[
-rwxr-xr-x 1 root root 22132 Aug 6 23:36 /usr/bin/[
--- cut ---

 
Old September 27th, 2006, 09:45 AM
Registered User
 
Join Date: Sep 2006
Location: Los Angeles, CA, USA.
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Aminm:

The command "ls -l /usr/bin/[" is not an example at all of using the open bracket. The author is just proving that the close bracket is not needed by showing that the '[' is merely a symlink to the test command.

Murdock




Similar Threads
Thread Thread Starter Forum Replies Last Post
teaching material dave1964_98 BOOK: Beginning ASP.NET 3.5 : in C# and VB BOOK ISBN: 978-0-470-18759-3 5 April 2nd, 2008 04:19 PM
Thanks for teaching me wwwbbb8510 EJB 0 November 17th, 2006 10:59 PM
Multiple conditions austinf XSLT 1 May 5th, 2006 02:55 AM
Multiple conditions austinf XSLT 1 May 5th, 2006 02:38 AM
Conditions in looping sridevi XSLT 0 July 31st, 2004 06:11 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.