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