From owner-freebsd-questions Wed Aug 8 14: 1:16 2001 Delivered-To: freebsd-questions@freebsd.org Received: from lcmail2.lc.ca.gov (lcmail2.lc.ca.gov [165.107.12.11]) by hub.freebsd.org (Postfix) with ESMTP id 6751237B405 for ; Wed, 8 Aug 2001 14:00:53 -0700 (PDT) (envelope-from drewt@writeme.com) Received: from CONVERSION-DAEMON by lcmail2.lc.ca.gov (PMDF V5.2-27 #40821) id <0GHR00901P2DXN@lcmail2.lc.ca.gov> for freebsd-questions@FreeBSD.ORG; Wed, 8 Aug 2001 14:01:27 -0700 (PDT) Received: from tagalong ([165.107.42.215]) by lcmail2.lc.ca.gov (PMDF V5.2-27 #40821) with SMTP id <0GHR00GMDP298T@lcmail2.lc.ca.gov> for freebsd-questions@FreeBSD.ORG; Wed, 08 Aug 2001 14:01:21 -0700 (PDT) Date: Wed, 08 Aug 2001 14:00:03 -0700 From: Drew Tomlinson Subject: RE: Scripting Help In-reply-to: <5CD46247635BD511B6B100A0CC3F0239E33F72@ldcmsx01.lc.ca.gov> To: 'Erik Trulsson' Cc: "'FreeBSD Questions (E-mail)'" Message-id: <5CD46247635BD511B6B100A0CC3F023925A050@ldcmsx01.lc.ca.gov> MIME-version: 1.0 X-MIMEOLE: Produced By Microsoft MimeOLE V5.50.4522.1200 X-Mailer: Microsoft Outlook CWS, Build 9.0.2416 (9.0.2911.0) Content-type: text/plain; charset="us-ascii" Content-transfer-encoding: 7bit Importance: Normal X-Priority: 3 (Normal) X-MSMail-priority: Normal Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG > -----Original Message----- > From: Erik Trulsson [mailto:ertr1013@student.uu.se] > Sent: Wednesday, August 08, 2001 11:44 AM > To: Drew Tomlinson > Cc: FreeBSD Questions (E-mail) > Subject: Re: Scripting Help > > > On Wed, Aug 08, 2001 at 11:37:02AM -0700, Drew Tomlinson wrote: > > 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" > > No need to use 'set'. Those lines should just read: > > web=$1 > odir="/usr/local/www/data/webalizer/$1" Thanks! This worked just fine. > > > > # Time stamp log > > date > > > > echo $web\n > > echo $odir\n > > The \n at the shouldn't be there. > The default behaviour for echo(1) is to add a newline at the end. > (Can be overridden by the -n flag.) > So this should be > > echo $web > echo $odir This worked too! Thanks, Drew To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message