
Shell Variables: Shell prompt OK, script, NO.
In article <3755d7dc.7493...@news.golden.net>,
willon...@bigfoot.com (Willondon Donovan) writes:
Try this in your script:
#! /bin/csh
set logdate = (`date +%Y%m%d`)
echo $logdate | tee test.dat
Refer to the manpage for csh, esp. the section "Expressions"
for a discussion on precedence of + % ` and ( as well as the
"Lexical structure", "Command substitution" and
"Quotations ..." sections.
Your own $HOME/.cshrc and $HOME/.login might afford some
helpful examples/hints.
You might also like to lurk in comp.unix.shell for some
very interesting and enlightening discussions on scripting.
If you post your question there, certain pedants would
recommend against naming your script "test" (there's already
a /bin/test) and/or for using csh for scripting at all (some
folks read a certain article in O'Reilly's "Unix Power
Tools" and take it as Gospel)
I won't bug ya, though :)
If you're /really/ interested in scripting, i recommend getting
a copy of "UNIX Shell Programming" by Stephen G. Kochan and
Patrick H. Wood. My copy is so old i don't know if its publisher
(Hayden Books) or ISBN are still valid.
HTH
cheers,
tom
--
Applicants must have at least five years' experience with Windows 98 ...
remove NO_SPAM. from address to reply