Wrox Programmer Forums
| Search | Today's Posts | Mark Forums Read
BOOK: Beginning Linux Programming, 4th Edition ISBN 978-0-470-14762-7
This is the forum to discuss the Wrox book Beginning Linux Programming, 4th Edition by Neil Matthew, Richard Stones; ISBN: 9780470147627
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning Linux Programming, 4th Edition ISBN 978-0-470-14762-7 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 March 8th, 2015, 11:03 AM
Registered User
Points: 11, Level: 1
Points: 11, Level: 1 Points: 11, Level: 1 Points: 11, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Apr 2012
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default shell mini cd manager question

Hello,
chapter 2 mini CD manager. Can any one please explain the next code:
in the function remove_records():
[code]

grep -v "^${cdcatnum}," $title_file > $temp_file
mv $temp_file $title_file
grep -v "^${cdcatnum}," $tracks_file > $temp_file
mv $temp_file $tracks_file

[code]
any help will be greatly appreciated.
thank you.
 
Old June 16th, 2018, 03:11 PM
Registered User
Points: 6, Level: 1
Points: 6, Level: 1 Points: 6, Level: 1 Points: 6, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2018
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default what does the grep do

the code finds lines in the file named title_file
Actually the code finds the lines that do NOT begin with the specified pattern
and saves all these lines in a temporary file. Then the next line renames the temporary file
and gives it the name of the existing file, so it actually substitutes the existing file with a file that does not have the specific lines , so in other words the specific lines were removed.




Similar Threads
Thread Thread Starter Forum Replies Last Post
[Apache_Tomcat]: $CATALINA_HOME/webapps/host-manager/manager.xml quanba Apache Tomcat 1 September 1st, 2011 07:16 PM
Mini dump file Baby_programmer BOOK: Professional Team Foundation Server ISBN: 0-471-91930-6 0 June 25th, 2008 03:37 PM
getObject() and shell() question using automation juneBugz Access VBA 0 August 29th, 2005 08:46 PM
CD-R and CD -RW info wwwdirzala Beginning VB 6 0 May 4th, 2004 04:00 AM
Shell Function Question SerranoG Access VBA 4 November 12th, 2003 07:57 PM





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