From owner-freebsd-questions@FreeBSD.ORG Tue Jul 22 23:15:17 2003 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 855EE37B405 for ; Tue, 22 Jul 2003 23:15:17 -0700 (PDT) Received: from ms-smtp-03.southeast.rr.com (ms-smtp-03.southeast.rr.com [24.93.67.84]) by mx1.FreeBSD.org (Postfix) with ESMTP id 4573D43FB1 for ; Tue, 22 Jul 2003 23:15:16 -0700 (PDT) (envelope-from marcus@marcuscom.com) Received: from creme-brulee.marcuscom.com (rdu57-17-158.nc.rr.com [66.57.17.158])h6N6DM93029563; Wed, 23 Jul 2003 02:13:22 -0400 (EDT) Received: from [192.168.1.4] (shumai.marcuscom.com [192.168.1.4]) h6N6EkiZ035472; Wed, 23 Jul 2003 02:14:46 -0400 (EDT) (envelope-from marcus@marcuscom.com) From: Joe Marcus Clarke To: David.Bear@asu.edu In-Reply-To: <20030722230432.J27866@asu.edu> References: <20030722230432.J27866@asu.edu> Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="=-rFOSY5qzPRB2Ri5Wvtif" Organization: MarcusCom, Inc. Message-Id: <1058940911.28333.25.camel@shumai.marcuscom.com> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.3 Date: 23 Jul 2003 02:15:11 -0400 X-Spam-Status: No, hits=-10.9 required=5.0 tests=BAYES_10,EMAIL_ATTRIBUTION,IN_REP_TO,PGP_SIGNATURE_2, QUOTED_EMAIL_TEXT,REFERENCES,REPLY_WITH_QUOTES, USER_AGENT_XIMIAN autolearn=ham version=2.55 X-Spam-Checker-Version: SpamAssassin 2.55 (1.174.2.19-2003-05-19-exp) cc: FreeBSD User Questions List Subject: Re: shell script help X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Jul 2003 06:15:17 -0000 --=-rFOSY5qzPRB2Ri5Wvtif Content-Type: text/plain Content-Transfer-Encoding: quoted-printable On Wed, 2003-07-23 at 02:04, David Bear wrote: > I'm trying to clean up a script that controls my tape better. Among > other things it sets some variable to use later. I've made an error > somewhere and I'm thinking that I'm missing the obvious since I cant > find the error. I want to set command line options for tar. Below > taroptions has what I want. Line 12 echo's the command. When I use > what line echo's to the console tar works. However, something is > happening with line 13 that makes tar mad. It tells me=20 >=20 > tar can't open the archive /dev/sa0 /var/log >=20 > Please advice -- I'm going blind trying understand this one. >=20 >=20 > 1 #!/bin/sh > 2 PATH=3D/bin:/usr/bin > 3 backupadmin=3D"iddwb@asu.edu" > 4 starttime=3D`date "+DATE: %Y-%m-%d%nTIME: %H:%M"` > 5 wrkdir=3D"/root" > 6 tmpfile=3D${wrkdir}"/cat.tmp" > 7 curfile=3D${wrkdir}"/tapelabel" > 8 catalog=3D${wrkdir}"/level1Tar.cat" > 9 datetime=3D`date "+DATE: %Y-%m-%d%nTIME: %H:%M"` > 0 taroptions=3D"--create --verbose --block-size 1 --read-full-blocks --bl= ock-compress --gzip --file " > 1 tapedev=3D"/dev/sa0" > 2 echo "tar "${taroptions}${tapedev}" /var/log " =20 > 3 tar ${taroptions}${tapedev}" /var/log " =20 > 4 exit How about: 0 taroptions=3D"--create --verbose --block-size 1 --read-full-blocks --block-compress --gzip --file" 1 tapedev=3D"/dev/sa0" 2 echo "tar ${taroptions} ${tapedev} /var/log" 3 tar ${taroptions} ${tapedev} /var/log Works for me. Joe --=20 PGP Key : http://www.marcuscom.com/pgp.asc --=-rFOSY5qzPRB2Ri5Wvtif Content-Type: application/pgp-signature; name=signature.asc Content-Description: This is a digitally signed message part -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.2 (FreeBSD) iD8DBQA/Hifvb2iPiv4Uz4cRAvQyAKCEv1zLqvf52Y3at5qyN4zIwNKY+gCeK9NA rJZT8dLoYzQxBo4C2XFQsXA= =hjAQ -----END PGP SIGNATURE----- --=-rFOSY5qzPRB2Ri5Wvtif--