Seeking advice on bash script
Hi folks,
I have following script but it only worked once. Steps performed as follows; save it /home/satimis/mkiso_new and chmod +x [satimis@localhost satimis]$ cat mkiso_new Code:
#!/bin/sh # sh -vx ./mkiso_new Code:
#!/bin/sh [root@localhost satimis]# ./mkiso_new /home/satimis/Working Remaining arguments /home/satimis/Working Adding /home/satimis/Working [root@localhost satimis]# ls /home/satimis/To_burn/ Image.iso [root@localhost satimis]# mount -t iso9660 /home/satimis/To_burn/Image.iso -o loop /mnt/floppy Files can be read. [root@localhost satimis]# umount /mnt/floppy 3) [root@localhost satimis]# rm /home/satimis/To_burn/Image.iso [root@localhost satimis]# ./mkiso_new /home/satimis/Working [root@localhost satimis]# ./mkiso_new /home/satimis/Document /homesatimis/Photo /home/satimis/Working [root@localhost satimis]# ./mkiso_new /home/satimis/Document/ /homesatimis/Photo/ /home/satimis/Working/ None of them can create Image.iso Remark: Code:
[root@localhost satimis]# ./mkiso_new /home/satimis/Working 4) With following command, Image.iso can be creaded # mkisofs -R -o /home/satimis/To_burn/Image.iso -l -graft-point -hide-rr-moved /Document/=/home/satimis/Document/ /Photo/=/home/satimis/Photo/ /Working/=/home/satimis/Working/ ...... Total translation table size: 0 Total rockridge attributes bytes: 735885 Total directory bytes: 1953792 Path table size(bytes): 14456 Max brk space used 5e2000 138979 extents written (271 MB) Image.iso created on /home/satimis/To_burn Could you please shed me some light. TIA B.R. satimis |
Isn't "mkisofs_args="-R -o ${ISO_FILE}..." supposed to be "mkisofs_args="-R -o $ISO_FILE..."?
|
Quote:
|
Hi folks,
Tks for your advice. Problem still remains intact. Made following change; $ cat mkiso_new Code:
#!/bin/sh Remaining arguments /home/satimis/Working/ Adding /home/satimis/Working/ # ls /home/satimis/To_burn/ No printout # ./mkiso_new /home/satimis/Working Remaining arguments /home/satimis/Working Adding /home/satimis/Working # ls /home/satimis/To_burn/ No printout # find / -name Image.iso find: /proc/2665/task: No such file or directory The funny thing is why it worked once only. B.R. satimis |
First, you seem to be missing the -graft-point argument to mkisofs.
2nd, the arugments to mkiso_new cannot end with / or else you can't get the part for the left side of = |
Hi mirradric,
Tks for your advice. Quote:
$ cat mkiso_new Code:
#!/bin/sh Quote:
Remaining arguments /home/satimis/Working Adding /home/satimis/Working [root@localhost satimis]# ls /home/satimis/To_burn/ No printout [root@localhost satimis]# ./mkiso_new /home/satimis/Document Remaining arguments /home/satimis/Document Adding /home/satimis/Document [root@localhost satimis]# ls /home/satimis/To_burn/ No printout [root@localhost satimis]# find / -name Image.iso find: /proc/2591/task: No such file or directory One thing I can't resolve. # ./mkiso_new /home/satimis/Working Remaining arguments /home/satimis/Working Adding /home/satimis/Working only worked once having created an Image.iso. It never works again. B.R. satimis |
Hi folks,
Further to my last posting, following script works without problem [satimis@localhost satimis]$ cat mkiso_01.iso Code:
#!/bin/sh Code:
INFO: UTF-8 character encoding detected by locale settings. Image.iso An Image.iso was created under /home/satimis/To_burn/ Now the remaining works are; 1) How to make /Working/=/home/satimis/Working/ variable, keeping the other 2 directories permanent. i.e. /Working/=/home/satimis/Working/ plus /dir-AAA/=/path/to/dir-AAA/ /dir-BBB/=/path/to/dir-BBB/ etc. can be added as optional. Or they can be ignored without added. 2) How to make "Image_01.iso" changed. i.e. "01" can be changed to read as "02 or 03 or 04, etc." TIA B.R. satimis |
All times are GMT -5. The time now is 04:27 AM. |