On Tuesday, July 23, 2002, at 03:43 , kent ho wrote:

> Please help. I want to expand the "date" command in the echo command:
>
> Ex:
>
> $log="/tmp/ito.log"
> `echo Warning: some text > $log`
>
> I need to expand the "date" command somewhere in this echo command, please
> show me how.

why go outside of perl to invoke the 'write to stdout'  of 'echo'
and then redirect it to a file???

in the shell the command would have looked like

        echo "Warning: `date` some text" > $log

hence you would want something like:

[jeeves:~] drieux% perl -e 'my $word_up = `echo -n "Warning \`date\` some 
text"`;\
print "<< $word_up>>\n";'


as others have noted you may wish to look at doing
this IN perl with perl's time functions

        cf: perldoc localtime

you may also want to think in terms of a 'log_me'
function that knows how to hide that....





ciao
drieux

---


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to