From owner-freebsd-questions Tue Aug 20 8:17:15 2002 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 51F8537B400 for ; Tue, 20 Aug 2002 08:17:12 -0700 (PDT) Received: from slate.dublin.wbtsystems.com (slate.dublin.wbtsystems.com [193.120.231.12]) by mx1.FreeBSD.org (Postfix) with ESMTP id 7640143E4A for ; Tue, 20 Aug 2002 08:17:11 -0700 (PDT) (envelope-from barry.byrne@wbtsystems.com) Received: from spiral (spiral.dublin.wbtsystems.com [193.120.231.190]) (authenticated bits=0) by slate.dublin.wbtsystems.com (8.12.5/8.12.5) with ESMTP id g7KFH8HI038238; Tue, 20 Aug 2002 16:17:08 +0100 (IST) From: "Barry Byrne" To: "MET" , "'freebsd-questions-en'" Subject: RE: Auto Answering a Command Prompt || Not best the best phrase Date: Tue, 20 Aug 2002 16:17:07 +0100 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook IMO, Build 9.0.2416 (9.0.2910.0) In-Reply-To: <001d01c2485a$28fc8710$6901a8c0@SURVIVAL> X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000 Importance: Normal X-Scanned-By: slate/MIMEDefang 2.17 (www . roaringpenguin . com / mimedefang) 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 You could try moving and/or deleting the file with the -f option prior to running tar, assuming the -f option overrides the request for confirmation. mv -f $ARCHIVED $ARCHIVED.$$ tar cjf $ARCHIVED Gunks_Ads.txt && rm -f $ARCHIVED.$$ - Barry -- Barry Byrne, IT Manager, WBT Systems, Block 2, Harcourt Centre Harcourt Street, Dublin 2, Ireland Email: barry.byrne@wbtsystems.com Web: www.wbtsystems.com > -----Original Message----- > From: owner-freebsd-questions@FreeBSD.ORG > [mailto:owner-freebsd-questions@FreeBSD.ORG]On Behalf Of MET > Sent: 20 August 2002 15:59 > To: 'freebsd-questions-en' > Subject: Auto Answering a Command Prompt || Not best the best phrase > > > The host I'm using has a little built in system to auto ask the user (no > matter what) if they want to overwrite (y/n) the file they're trying to > save or archive/compress in this case. So every time I run my script is > asks me a question. I need the script to run as a Cronjob at a > ridiculous time in the morning by itself. So I'm trying to force the > 'yes' down its throat, but I don't know how. Here's my current > compression line: > > DATE=`date +%m-%d-%Y`; > ARCHIVED="Gunks_Ads-$DATE.tar.bz2"; > tar cjf ../backups/$ARCHIVED ../backups/Gunks_Ads.txt; > > So...how do I stuff a 'yes' down its throat after the last command > above? > > > ~ Matthew > > > To Unsubscribe: send mail to majordomo@FreeBSD.org > with "unsubscribe freebsd-questions" in the body of the message > To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message