LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
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, 06:04 AM   #1
antken
Member
 
Registered: Nov 2000
Posts: 368

Rep: Reputation: Disabled
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, 07: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, 07:56 AM   #3
antken
Member
 
Registered: Nov 2000
Posts: 368

Original Poster
Rep: Reputation: Disabled
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



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 12:25 AM
Bash Scripting Empty file john8675309 Linux - Software 2 08-08-2007 04:05 PM
bash scripting - how to make config file? Neorio Programming 3 10-22-2004 06:39 AM
bash scripting read from file cadj Programming 2 02-29-2004 10:42 PM
bash scripting - largest # file extension brian0918 Programming 3 06-16-2003 12:06 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 03:47 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
Open Source Consulting | Domain Registration