simple shell script for running awstats
Greg Rundlett
greg at freephile.com
Mon Jun 30 21:52:24 EDT 2003
On Monday 30 June 2003 08:10 pm, Derek Martin wrote:
> Well, I doubt this is causing a problem for you, but my suggestion to
> you is to *NEVER EVER EVER* invoke a shell script as /bin/bash, but
> instead as /bin/sh. The former sources the environment files of the
> user running the script, which is almost certainly not what you want,
> unless you're positive that it is...
That was not my intent, and I didn't even know there was a difference, so
thanks for pointing this out.
> After reviewing the other messages in this thread, it seems most
> likely to me that what you want to do here is enclose the expression
> within backquotes in single quotes, i.e.:
>
> -logfile='`gzip -d <$n |`'
>
> The way you wrote it, the script is actually unzipping the log file
> and passing its contents to the awstats.pl program as the argument to
> the -logfile parameter. The single quotes tell the shell to pass
> what's between them as-is to the program.
Thanks, I'll give that a try. Would the $n then be expanded (interpolated?)
by the shell script even though it is in single quotes?, or should I use
double quotes to get that effect?
--
Greg Rundlett
FREePHILE
We are 'Open' for Business
(Free Software on Linux)
www.freephile.com
fortune:
The light at the end of the tunnel is the headlight of an approaching train.
More information about the gnhlug-discuss
mailing list