sudo multiple commands at once without shell script

2008-10-25 Thread Kelly Jones
How do I run multiple sudo commands at once? This fails because the
semicolon ends the whole sudo command:

 sudo whoami; whoami
root
user

This confuses tcsh:

monica:~ sudo ( whoami ; whoami )
Badly placed ()'s.

I could obviously write a shell script or something or do:

 sudo whoami; sudo whoami

but is there a better way?

-- 
We're just a Bunch Of Regular Guys, a collective group that's trying
to understand and assimilate technology. We feel that resistance to
new ideas and technology is unwise and ultimately futile.
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: sudo multiple commands at once without shell script

2008-10-25 Thread perryh
 How do I run multiple sudo commands at once? This fails
 because the semicolon ends the whole sudo command:

  sudo whoami; whoami
 root
 user

 This confuses tcsh:

 monica:~ sudo ( whoami ; whoami )
 Badly placed ()'s.

Supposing sudo spawns a shell, something like

  ~ sudo whoami \; whoami

or

  ~ sudo whoami; whoami

should work.  If not, maybe try explicitly running a shell:

  ~ sudo sh -c whoami; whoami
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: sudo multiple commands at once without shell script

2008-10-25 Thread Tom Marchand

This works for me:

sudo sh -c whoami;whoami



On Oct 25, 2008, at 9:11 PM, Kelly Jones wrote:


How do I run multiple sudo commands at once? This fails because the
semicolon ends the whole sudo command:


sudo whoami; whoami

root
user

This confuses tcsh:

monica:~ sudo ( whoami ; whoami )
Badly placed ()'s.

I could obviously write a shell script or something or do:


sudo whoami; sudo whoami


but is there a better way?

--  
We're just a Bunch Of Regular Guys, a collective group that's trying

to understand and assimilate technology. We feel that resistance to
new ideas and technology is unwise and ultimately futile.
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED] 



___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]