> Try this:
> 
> cmd1=`echo This is command 1`
> cmd2=`echo This is command 2`
> 
> time { echo $cmd1 && echo $cmd2; }

This resulted in the command being echo'd back.  I believe what you meant was
cmd1=`This is command 1`
cmd2=`This is command 2`
time{ echo $cmd1 && echo $cmd2; }

That is what I was looking for.  Thanks.

> the use of echo in that scenario is imporatant.  Of course, if you're
> only using the command and variable *once* in the entire scriptlet, it
> may make sense to just hard-wire the command into the time statement.

Absolutely.  Really, the reason why I want to store the command is
because I want to echo the command and then run it, so when I look at
the log I'll know the arguments that were actually run.  So what I
want is something like this

{ time { \
    echo Configuring $PROGRAM &&
    echo $cmd1 &&
    $cmd1 &&
    ...
    }
} 2>&1 | tee $LOG

It just seemed convenient to store the parameters in a variable, but I
decided to just hardcode everything to be safe.  Maybe what I really
want is a Makefile.  Thanks anyway.
--
http://linuxfromscratch.org/mailman/listinfo/lfs-support
FAQ: http://www.linuxfromscratch.org/lfs/faq.html
Unsubscribe: See the above information page

Reply via email to