[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: logging a bash script using sudo and time



I forget the semicolon:
{ time sudo echo 'hi mon' ; } 2> file.log

On Sat, Sep 27, 2008 at 12:17 AM, Javier Barroso <javibarroso@gmail.com> wrote:
> On Wed, Sep 24, 2008 at 4:19 PM, Eugene V. Lyubimkin
> <jackyf.devel@gmail.com> wrote:
>> Brian McKee wrote:
>> ...
>>> Can someone explain the redirection going on here in a way I can grok?
>> 'time' writes output to stderr, use "time sudo echo 'hi mom' 2>&1"
>
> I would use:
>
> { time sudo echo 'hi mon' } 2> file.log
>
> I don't know why it is needed '{' trick.
>
> Regards
>


Reply to: