LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
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.

Notices

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

Rep: Reputation: 30
Question


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
thanks


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

Rep: Reputation: 15
bash ...

#!/bin/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
antken
Member
 
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!
thanks


 
  


Reply


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


All times are GMT -5. The time now is 11:43 PM.

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