Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 08 Aug 2001 11:37:02 -0700
From:      Drew Tomlinson <drewt@writeme.com>
To:        "FreeBSD Questions (E-mail)" <freebsd-questions@FreeBSD.org>
Subject:   Scripting Help
Message-ID:  <5CD46247635BD511B6B100A0CC3F023925A04F@ldcmsx01.lc.ca.gov>

next in thread | raw e-mail | index | archive | help
I'm attempting to write one of my first scripts.  What I want to do is
create a simple script that I can pass arguments to from the command line
and have it run the appropriate webalizer command(s) to create stats for
various virtual hosts on my machine.  However, I am running into problems
figuring out how to set variables in the script.  Here is what I have so
far:

#! /bin/sh

#  8/8/01
#  An attempt to write script to run webalizer to generate web stats for all
#  virtual web sites.

#  Set command line variables
set web=$1
set odir="/usr/local/www/data/webalizer/$1"

#  Time stamp log
date

echo $web\n
echo $odir\n
exit

When run, this is my output:

blacklamb# ./webalizer_run.sh test
Wed Aug  8 11:26:40 PDT 2001
n
n
blacklamb#

What I expect to happen is that the variable "web" is set to "test" and the
variable "odir" is set to "/usr/local/www/data/webalizer/test".  Then the
echo line print the settings to confirm.  Once I get this part "dialed in",
then I plan to use the variable in a line such as "webalizer -O $odir".

So can anyone enlighten me as to what I'm missing?  Any links, RTFMs, etc.
to scripting help is appreciated.

Thanks,

Drew


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?5CD46247635BD511B6B100A0CC3F023925A04F>