Results 1 to 4 of 4
not sure why i am getting the following error
./mount: line 7: [1: command not found
./mount: line 11: [1: command not found
./mount: line 15: [1: command not found
...
- 09-01-2010 #1
If command issues
not sure why i am getting the following error
./mount: line 7: [1: command not found
./mount: line 11: [1: command not found
./mount: line 15: [1: command not found
./mount: line 19: [1: command not found
./mount: line 23: [1: command not found
./mount: line 27: [1: command not found
No Such Disk
++ WARN: could not retrieve file info for `-o': No such file or directory
Code:#!/bin/bash # Mount debian disks echo -e "Which disk would you like to mount? 1-5 or u for update" read disk if [$disk = 1] then MNT=/media/disk1; DSK=/home/cingbug/Install\ Disks/debian-505-i386-DVD-1.iso elif [$disk = 2] then MNT=/media/disk2; DSK=/home/cingbug/Install\ Disks/debian-505-i386-DVD-2.iso elif [$disk = 3] then MNT=/media/disk3; DSK=/home/cingbug/Install\ Disks/debian-505-i386-DVD-3.iso elif [$disk = 4] then MNT=/media/disk4; DSK=/home/cingbug/Install\ Disks/debian-505-i386-DVD-4.iso elif [$disk = 5] then MNT=/media/disk5; DSK=/home/cingbug/Install\ Disks/debian-505-i386-DVD-5.iso elif [$disk = u] then MNT=/media/update; DSK=/home/cingbug/Install\ Disks/debian-update-5.0.5-i386-DVD-1.iso else echo -e "No Such Disk" fi fuseiso9660 $DSK $MNT -o allow_other
- 09-01-2010 #2Just Joined!
- Join Date
- Sep 2010
- Posts
- 5
looks like you need a space after [ and before $disk. Also, the DSK varialbe needs qoute marks around it.
- 09-01-2010 #3
Found one solution
Code:#!/bin/bash # Mount debian disks echo -e "Which disk would you like to mount? 1-5 or 6 for update" read disk if [ $disk -eq 1 ] then MNT=/media/disk1; DSK=/home/cingbug/Install_Disks/debian-505-i386-DVD-1.iso elif [ $disk -eq 2 ] then MNT=/media/disk2; DSK=/home/cingbug/Install_Disks/debian-505-i386-DVD-2.iso elif [ $disk -eq 3 ] then MNT=/media/disk3; DSK=/home/cingbug/Install_Disks/debian-505-i386-DVD-3.iso elif [ $disk -eq 4 ] then MNT=/media/disk4; DSK=/home/cingbug/Install_Disks/debian-505-i386-DVD-4.iso elif [ $disk -eq 5 ] then MNT=/media/disk5; DSK=/home/cingbug/Install_Disks/debian-505-i386-DVD-5.iso elif [ $disk -eq 6 ] then MNT=/media/update; DSK=/home/cingbug/Install_Disks/debian-update-5.0.5-i386-DVD-1.iso else echo -e "No Such Disk" fi fuseiso9660 $DSK $MNT -o allow_other
- 09-02-2010 #4Just Joined!
- Join Date
- Feb 2009
- Location
- Southport, England
- Posts
- 31
yes, the test brackets [ ] always need a space between them and what's inside.


Reply With Quote