[ale] Bash Scripting: How to pass "yes" + carriage return?

Al Snow jasnow at hotmail.com
Fri Nov 11 19:08:28 EST 2005


Try this in your bash script:
    echo "y" | cmuExport
Al Snow

>From: "Ryan Fish" <FishR at bellsouth.net>
>Reply-To: FishR at bellsouth.net,Atlanta Linux Enthusiasts <ale at ale.org>
>To: "'Atlanta Linux Enthusiasts'" <ale at ale.org>
>Subject: [ale] Bash Scripting: How to pass "yes" + carriage return?
>Date: Fri, 11 Nov 2005 07:22:29 -0500
>
>Hello all,
>
>I am in need of figuring out how to pass a "yes" followed by a carriage
>return via a bash script so a backup process can run successfully each day.
>
>The script does the following:
>
>1) ssh to RaQ server as root
>2) run cmuExport
>3) copies contents of export to NAS device
>
>Since cmuExport has been run before a prompt stating the directory the file
>is written to already exists, do I want to overwrite is returned.  The only
>way to get past this point is to enter "y" then press ENTER at the prompt.
>This is what I am attempting to automate.
>
>Thank you for any help offered!
>-Ryan
EOF





More information about the Ale mailing list