Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 25 Oct 2008 21:40:17 -0400
From:      Tom Marchand <m0rchand@comcast.net>
To:        freebsd-questions@freebsd.org
Subject:   Re: sudo multiple commands at once without shell script
Message-ID:  <040D18B2-E661-45BB-942B-9859ECA080C6@comcast.net>
In-Reply-To: <26face530810251811i3757db68wb7ed44faaf51444b@mail.gmail.com>
References:  <26face530810251811i3757db68wb7ed44faaf51444b@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
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 "freebsd-questions-unsubscribe@freebsd.org 
> "




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?040D18B2-E661-45BB-942B-9859ECA080C6>