Date: Tue, 20 Aug 2002 11:04:26 -0400 From: Anish Mistry <mistry.7@osu.edu> To: MET <met@uberstats.com> Cc: freebsd-questions@freebsd.org Subject: Re: Auto Answering a Command Prompt || Not best the best phrase Message-ID: <200208201104.26493.mistry.7@osu.edu> In-Reply-To: <001d01c2485a$28fc8710$6901a8c0@SURVIVAL> References: <001d01c2485a$28fc8710$6901a8c0@SURVIVAL>
next in thread | previous in thread | raw e-mail | index | archive | help
On Tuesday 20 August 2002 10:59 am, MET wrote: > The host I'm using has a little built in system to auto ask the user (n= o > 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 i= s > 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: >=20 > DATE=3D`date +%m-%d-%Y`; > ARCHIVED=3D"Gunks_Ads-$DATE.tar.bz2"; > tar cjf ../backups/$ARCHIVED ../backups/Gunks_Ads.txt; >=20 > So...how do I stuff a 'yes' down its throat after the last command > above? >=20 >=20 > ~ Matthew >=20 >=20 > To Unsubscribe: send mail to majordomo@FreeBSD.org > with "unsubscribe freebsd-questions" in the body of the message >=20 >=20 Just pipe the output of the 'yes' program to tar: yes | tar cjf ../backups/$ARCHIVED ../backups/Gunks_Ads.txt; --=20 Anish Mistry 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?200208201104.26493.mistry.7>