I try to mount an iso file from a script, but it doesn't work. However the same command functions normally when executed from bash. Why? I'm suspecting it's because the command needs
sudo mount -t iso9660 myiso.iso mydir 2> /dev/null
This is the exact command I have in my script. No errors when I run the script (
2> /dev/null, duh), but not even when I remove this part, since the script simply doesn't mount. I've tried running the script with
sh script.sh and nothing happens, same by running
./script.sh. The script has full permissions.
When I execute this command in bash it works, if I remove the
/dev/null part it gives the typical warning that the file was mounted in read-only mode.
#! /bin/bash mkdir mydir sudo mount -t iso9660 myiso.iso mydir
That's my script.