and you tell me I need to make it executable.
I didn't say that you NEED to make it executable. This is an option and in some cases the best option. This is what I meant by 'it has its place'. In this case when a script recalls itself it is much easier to make the script executable. If you don't then you need to make the script recall itself using sh. For example (I am in kde right now)
kdesu -c 'sh $0' Wouldn't it be easier to just use 'su' instead of opening a gui to enter your password?
In that case it would be something like:
su - -c 'sh $0'
Then you say I don't need to if I run it with the 'sh' command which is what I was doing when it failed to run.
Take a closer look at your script. When YOU invoke the script you are using 'sh' but when the script sees you are not root, it reruns ITSELF (using ktsuss) without using 'sh'
Regarding running scripts from a windows partition. You don't the shebang or the executable bit set. Try it to see for yourself:
Code: Select all
echo "echo working" > /mnt/sda4/test
/mnt/sda4/test
/mnt/sda4 in this case is any FAT ro NTFS partition