Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 26 Dec 1999 16:30:22 -0600
From:      Dan Nelson <dnelson@emsphone.com>
To:        Chris Byrnes <chris@shell.jeah.net>
Cc:        questions@FreeBSD.ORG
Subject:   Re: "yes"
Message-ID:  <19991226163022.A79675@dan.emsphone.com>
In-Reply-To: <199912242005.OAA36145@shell.jeah.net>; from "Chris Byrnes" on Fri Dec 24 14:05:35 GMT 1999
References:  <199912242005.OAA36145@shell.jeah.net>

next in thread | previous in thread | raw e-mail | index | archive | help
In the last episode (Dec 24), Chris Byrnes said:
> What is the purpose of the "yes" command?  I have not seen anything
> useful that uses it.

Its purpose is to replace the shell script

while : ; do echo "yes" ; done

(replace the string "yes" with any constant string you like).  It's
mainly used to provide input to interactive programs that you want to
run from a script, to skip past "are you sure" -type prompts.
 
> I have, however, seen people abuse it.. i.e: "yes poop >
> your-drive-is-full"

"dd if=/dev/zero of=your-drive-is-full bs=1m" or "cat /dev/zero >
bigfile" would be quite a bit more efficient.
 
> It's 700'd root right now, but that's not the point.

If you have problems with people filling up filesystems, consider
quotas.

-- 
	Dan Nelson
	dnelson@emsphone.com


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?19991226163022.A79675>