Re: Using sudo in a script.

2016-08-03 Thread deloptes
Ken Heard wrote: > -BEGIN PGP SIGNED MESSAGE- > Hash: SHA1 > > On 2016-08-03 15:16, Jude DaShiell wrote: >> Why not try a -H switch on the sudo line in your script and see >> what happens? > > I did. The answer was nothing. why bother users run sudo commands when they can use the

Re: Using sudo in a script.

2016-08-03 Thread Ken Heard
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 2016-08-03 15:16, Jude DaShiell wrote: > Why not try a -H switch on the sudo line in your script and see > what happens? I did. The answer was nothing. Regards, Ken -BEGIN PGP SIGNATURE- Version: GnuPG v2

Re: Using sudo in a script.

2016-08-03 Thread Ken Heard
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 2016-08-03 12:21, Ken Heard wrote: > I would like to create a short script to mount and unmount SCXC > cards. For these exfat cards to do either in Jessie has to be done > as root. > > I have set up sudo so that my user can run any command as

Re: Using sudo in a script.

2016-08-03 Thread Don Armstrong
On Wed, 03 Aug 2016, Ken Heard wrote: > I would like to create a short script to mount and unmount SCXC cards. > For these exfat cards to do either in Jessie has to be done as root. > > I have set up sudo so that my user can run any command as root. the > following command will mount the card

Using sudo in a script.

2016-08-03 Thread Ken Heard
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 I would like to create a short script to mount and unmount SCXC cards. For these exfat cards to do either in Jessie has to be done as root. I have set up sudo so that my user can run any command as root. the following command will mount the card

Re: using SUDO in bash script

2004-02-05 Thread Michael Rauch
Rick Weinbender wrote: Adam Aube wrote: On Wednesday 04 February 2004 03:23 pm, Rick Weinbender wrote: Can I use SUDO within a bash script? Absolutely, though be aware that if sudo is set to require a password, you won't be able to run it in the background. By putting NOPASSWD before the

Re: using SUDO in bash script

2004-02-05 Thread Kent West
Michael Rauch wrote: instead of writing a shellscript you could also use aliases in the bash shell (don't know if it works in other shells though). to have your aliases available all the time, you can but them in your .bashrc file in your $HOME directory (you will probably already find some

Re: using SUDO in bash script

2004-02-05 Thread Micha Feigin
On Thu, Feb 05, 2004 at 01:41:43PM +0100, Michael Rauch wrote: Rick Weinbender wrote: Adam Aube wrote: On Wednesday 04 February 2004 03:23 pm, Rick Weinbender wrote: Can I use SUDO within a bash script? Absolutely, though be aware that if sudo is set to require a password, you won't

Re: using SUDO in bash script

2004-02-05 Thread Rick Weinbender
Micha Feigin wrote: On Thu, Feb 05, 2004 at 01:41:43PM +0100, Michael Rauch wrote: Rick Weinbender wrote: Adam Aube wrote: On Wednesday 04 February 2004 03:23 pm, Rick Weinbender wrote: Can I use SUDO within a bash script? Absolutely, though be aware that if sudo is set to

using SUDO in bash script

2004-02-04 Thread Rick Weinbender
Can I use SUDO within a bash script? ie: #!/bin/sh sudo myprogram Thanks, -Rick -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]

Re: using SUDO in bash script

2004-02-04 Thread Adam Aube
On Wednesday 04 February 2004 03:23 pm, Rick Weinbender wrote: Can I use SUDO within a bash script? Absolutely, though be aware that if sudo is set to require a password, you won't be able to run it in the background. By putting NOPASSWD before the command in /etc/sudoers, sudo will not

Re: using SUDO in bash script

2004-02-04 Thread Rick Weinbender
Adam Aube wrote: On Wednesday 04 February 2004 03:23 pm, Rick Weinbender wrote: Can I use SUDO within a bash script? Absolutely, though be aware that if sudo is set to require a password, you won't be able to run it in the background. By putting NOPASSWD before the command in

Re: using SUDO in bash script

2004-02-04 Thread Adam Aube
On Wednesday 04 February 2004 04:09 pm, Rick Weinbender wrote: Can I avoid typing sudo before myprogram at the commandline? Yes - it works just like the article you quoted describes it. Adam -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of unsubscribe. Trouble? Contact [EMAIL