The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

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 and shell scripting languages 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 04:31 PM
Howto Detect New Nic Card chakri.penguin Linux 0 04-07-2006 12:25 AM
xterm detect inquirer Shell Programming and Scripting 2 11-27-2002 05:33 PM
How to detect process pkanonwe Shell Programming and Scripting 2 10-18-2002 10:33 AM
Not able to detect nr of cpu in Solaris System pbonato UNIX for Dummies Questions & Answers 1 04-04-2002 09:29 AM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 07-24-2008
jisha jisha is offline
Registered User
  
 

Join Date: Jan 2008
Location: Bangalore,India
Posts: 144
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
  #2 (permalink)  
Old 07-24-2008
jisha jisha is offline
Registered User
  
 

Join Date: Jan 2008
Location: Bangalore,India
Posts: 144
My OS is red hat linux 8.0
  #3 (permalink)  
Old 07-24-2008
BMDan BMDan is offline
Registered User
  
 

Join Date: Jul 2008
Location: BlackMesh Managed Hosting
Posts: 66
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
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 10:24 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0