LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   Bash BkUp script (https://www.linuxquestions.org/questions/linux-general-1/bash-bkup-script-762828/)

drmjh 10-18-2009 04:07 PM

Bash BkUp script
 
I am trying to write my first script. It's not much of an effort, but I would like to understand why it doesn't work and the principle behind the correction.

Code:

su

growisofs -Z /dev/dvd -dvd-compat -r -v /home

It executes the 'su' and accepts my PW and then stops.

Raum the Old 10-18-2009 05:51 PM

su starts a new shell.

Tux-Slack 10-19-2009 12:44 AM

If you want to run the command as root, use sudo or try su -c "command"

drmjh 10-19-2009 08:33 AM

Thanks everybody!
The fact that a new shell was opened I assumed but I also assumed that the same thing would happen if I used "sudo" or "su -c" and that's why I didn't try them.
Matthew


All times are GMT -5. The time now is 01:50 AM.