Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 20 Aug 2002 16:17:07 +0100
From:      "Barry Byrne" <barry.byrne@wbtsystems.com>
To:        "MET" <met@uberstats.com>, "'freebsd-questions-en'" <freebsd-questions@FreeBSD.ORG>
Subject:   RE: Auto Answering a Command Prompt || Not best the best phrase
Message-ID:  <NCBBIAMNAKDKFJIIGNPKMEAEJFAA.barry.byrne@wbtsystems.com>
In-Reply-To: <001d01c2485a$28fc8710$6901a8c0@SURVIVAL>

next in thread | previous in thread | raw e-mail | index | archive | help
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




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