The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
Google UNIX.COM


Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
How to detect if a Windows app dies?? jimmyc Windows & DOS: Issues & Discussions 6 12-07-2006 12:31 PM
Howto Detect New Nic Card chakri.penguin Linux 0 04-06-2006 09:25 PM
xterm detect inquirer Shell Programming and Scripting 2 11-27-2002 01:33 PM
How to detect process pkanonwe Shell Programming and Scripting 2 10-18-2002 07:33 AM
Not able to detect nr of cpu in Solaris System pbonato UNIX for Dummies Questions & Answers 1 04-04-2002 06:29 AM

Reply
 
Submit Tools LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 07-24-2008
Registered User
 

Join Date: Jan 2008
Location: Bangalore,India
Posts: 132
Stumble this Post!
Arrow How to detect whethere the CD is R or RW

Hi all,

I need to write a script to write data into cd.
Am using cdrecord command.
i need to implement the following

if ( CD-RW) ( ?? How to find this )
cdrecord blank option
else
cdrecord with out blank option

Now can you please help me to form this statement correctly ?
Basically i need the if "condition "
if ( ????)

Thanks in advance
JS
Reply With Quote
Forum Sponsor
  #2 (permalink)  
Old 07-24-2008
Registered User
 

Join Date: Jan 2008
Location: Bangalore,India
Posts: 132
Stumble this Post!
My OS is red hat linux 8.0
Reply With Quote
  #3 (permalink)  
Old 07-24-2008
Registered User
 

Join Date: Jul 2008
Location: BlackMesh Managed Hosting
Posts: 61
Stumble this Post!
Something like:

Code:
#Add any needed device specifications to the line below; by default, it'll use /dev/cdrom.
cdrecord -atip | grep -F 'Is erasable'
if [ $? -eq 0 ]; then
    #cdrecord blank option goes here
else
    #cdrecord CD-R option goes here
fi
Reply With Quote
Google The UNIX and Linux Forums
Reply

Thread Tools
Display Modes




All times are GMT -7. The time now is 01:25 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008 The CEP Blog All Rights Reserved -Ad Management by RedTyger Visit The Global Fact Book

Content Relevant URLs by vBSEO 3.2.0