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
  #1 (permalink)  
Old September 12th, 2004, 09:49 PM
Registered User
 
Join Date: Sep 2004
Location: Brooklyn, NY, USA.
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default Chapter 2: Use of :- in cd_db

The code ':-' appears in three different locations apparently unrelated to parameter expansion in the 'cd_db' CD project which concludes Chapter 2.

1. function: set_menu_choice()

    echo "Options :-"

2. function: update_cd()

    echo "Current tracks are :-"

3. function: list_tracks()

    echo "$cdtitle :-"

Since in these three locations ':-' does NOT occur in the context of parameter expansion (as discussed on p 71, e.g., ${param:-default}), I don't see what ':-' adds here ... except for confusion.

Jim Keenan


Just Another Perl Hacker
  #2 (permalink)  
Old August 25th, 2006, 11:11 AM
Registered User
 
Join Date: Aug 2006
Location: , , .
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I believe they are being used as part of the text you should see.
for example the line
echo "Options :-" will echo all characters in quotes, so you will see

Options :-

it is just text, not a parameter expansion.

good day


Similar Threads
Thread Thread Starter Forum Replies Last Post
Chapter 2 - End of chapter exercises whizzkid1892 BOOK: Beginning PHP5, Apache, and MySQL Web Development ISBN: 978-0-7645-7966-0 1 July 30th, 2008 12:02 PM
chapter 7 - chapter 11 pelopito BOOK: Beginning CSS: Cascading Style Sheets for Web Design ISBN: 978-0-7645-7642-3 3 January 6th, 2008 11:40 AM
Generics chapter 12 difficult chapter i found ...? Larryz C# 2005 1 July 4th, 2007 09:40 PM





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