Latest LQ Deal: Linux Power User Bundle
Go Back > Forums > Linux Forums > Linux - General
User Name
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.


  Search this Thread
Old 01-22-2001, 07:04 AM   #1
Registered: Nov 2000
Location: england
Distribution: latest Mandrake
Posts: 368

Rep: Reputation: 30

just me again,
i have set up a small linux mandrake box to act as a cd server basicly you put cd in type a command and it makes an ISO file type a nother command and its mounted as a loop back device.
what i would like to do if its possible
is to either create a batch file that will automate this process, or make linux pickup a new cd in the drive readit in to an iso file and mount it as a loop back device.
i have got the commands from the cdserver howto
for the batch type method i would like to do somthing like:

readcd2iso *iso path and name*

mntiso *iso path and name* *mount point*

on ms windoze and dos in the batch file you just use %1 for the first word %2 for the second and so on like so hello.bat %1 %2 %3
on the command line you use your prams in place of the %1 %2
is it the same in linux?
and if anybody knows how would you make linux sense a cd in the drive and perform those above commands and eject the cd

any help or insight will be appreciated

Old 01-22-2001, 08:39 AM   #2
LQ Newbie
Registered: Jan 2001
Location: Santiago, Chile
Posts: 21

Rep: Reputation: 15
bash ...

# ksh, sh & bash compatible, in this shells (and others)
# parameters are $1 $2 ... and so on, when you reach the
# 10th parameter it will work with ${10}, ${11}, ... etc

# Add your validations here
readcd2iso $1
mntiso $1 $2
echo "Pronto!"
Old 01-22-2001, 08:56 AM   #3
Registered: Nov 2000
Location: england
Distribution: latest Mandrake
Posts: 368

Original Poster
Rep: Reputation: 30
Thumbs up thanks that work great!

Thanks thats great

can i use ' if ' statements?

like if $1 = "" then
echo OOPS!
else echo OKAY!



Thread Tools Search this Thread
Search this Thread:

Advanced Search

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

Similar Threads
Thread Thread Starter Forum Replies Last Post
BASH Shell Scripting -- foreach file in folder??? AC97Conquerer Programming 11 07-06-2011 01:25 AM
Bash Scripting Empty file john8675309 Linux - Software 2 08-08-2007 05:05 PM
bash scripting - how to make config file? Neorio Programming 3 10-22-2004 07:39 AM
bash scripting read from file cadj Programming 2 02-29-2004 11:42 PM
bash scripting - largest # file extension brian0918 Programming 3 06-16-2003 01:06 PM > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 01:25 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration