LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 10-18-2009, 04:07 PM   #1
drmjh
Member
 
Registered: Mar 2005
Location: North Carolina, USA
Distribution: Ubuntu
Posts: 308

Rep: Reputation: 31
Question 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.
 
Old 10-18-2009, 05:51 PM   #2
Raum the Old
LQ Newbie
 
Registered: Jul 2008
Location: Southern California
Distribution: Debian, Ubuntu
Posts: 22

Rep: Reputation: 3
su starts a new shell.
 
Old 10-19-2009, 12:44 AM   #3
Tux-Slack
Member
 
Registered: Nov 2006
Location: Slovenia
Distribution: Slackware 13.37
Posts: 511

Rep: Reputation: 37
If you want to run the command as root, use sudo or try su -c "command"
 
Old 10-19-2009, 08:33 AM   #4
drmjh
Member
 
Registered: Mar 2005
Location: North Carolina, USA
Distribution: Ubuntu
Posts: 308

Original Poster
Rep: Reputation: 31
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
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Using a long Bash command including single quotes and pipes in a Bash script antcore Linux - General 9 07-22-2009 11:10 AM
Strange if statement behaviour when using bash/bash script freeindy Programming 7 08-04-2008 06:00 AM
Which distro should i try for home bkup server tjk176 Linux - Server 7 11-27-2007 12:43 PM
Fedora C3, want to dual boot and have access to bkup drive. Skuggi Linux - General 10 01-19-2005 02:45 AM
retrieving bkup.tar.gz burned as an .iso ursar Linux - Software 1 12-05-2003 01:38 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 05:22 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration