LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices

Reply
 
Search this Thread
Old 10-05-2004, 11:04 AM   #1
satimis
Senior Member
 
Registered: Apr 2003
Posts: 3,427

Rep: Reputation: 53
Seeking advice on script


Hi folks,

I have following script saved to /usr/sbin/make_iso_file

1)
Code:
function make_iso_file ()
{
    # initialize the following loop
    # we're going to build the args to mkisofs, set it to the empty string
    mkisofs_args="-R -o Image.iso -J -hide-rr-moved Document=/home/satimis/Document Photo=/home/satimis/Photo"
    # and set the paths variable to all the remaining command-line arguments
    paths="$@"
    # and now iterate through all paths given on the command-line
    for path in $paths
    do
        # for each path given, add the appropriate graft-point to mkisofs's arguments
        mkisofs_args="${mkisofs_args} ${path##*/}=${path}"
    done

    # and now call mkisofs
    mkisofs $mkisofs_args
}

2)
My goal is to create an ISO image applying following command line

# mkisofs -R -o Image.iso -J -hide-rr-moved Document=/path/to/Document Photo=/path/to/Photo"

from following directories;
Document=/path/to/Document
Photo=/path/to/Photo

plus argument for adding further directories with variated path, such as

dir-A=/path/to/dir-A
dir-B=/path/to/dir-B
etc.

which are added during executing the file "make_iso_file"

3)
# chmod +x /usr/sbin/make_iso_file

4)
# /usr/sbin/make_iso_file
/usr/sbin/make_iso_file: line 15: unexpected EOF while looking for matching `''
/usr/sbin/make_iso_file: line 22: syntax error: unexpected end of file

Kindly advise how to fix the problem. TIA

B.R.
satimis
 
Old 10-05-2004, 03:02 PM   #2
Hko
Senior Member
 
Registered: Aug 2002
Location: Groningen, The Netherlands
Distribution: ubuntu
Posts: 2,530

Rep: Reputation: 108Reputation: 108
Is that your entire script?
You need at least actually call the function by adding as the last line:

make_iso_file $@
 
  


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 Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
seeking advice regarding Slackware adityavpratap Slackware 25 10-20-2005 11:47 AM
Seeking advice on HP printer selection satimis Fedora 0 02-22-2005 06:52 AM
Seeking advice for size optimiztion praj_linux Programming 5 10-11-2004 11:02 PM
Seeking advice on bash script satimis Programming 6 10-11-2004 11:01 AM
Seeking Diagnosis Advice... verbal Linux - Hardware 2 09-12-2003 06:11 AM


All times are GMT -5. The time now is 09:28 AM.

Main Menu
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