My Octopress Blog

A blogging framework for hackers.

Yes(1)

Yes, yes(1) is built-in to Mac and Linux (at least OS X Lion and Ubuntu 11.04). And, as you might guess, it repeatedly prints a string of your choice (‘y’ by default) followed by a newline to stdout. Its sole purpose in life is to automate agreeing to prompts. I encountered it recently in a script that was automating RAID array deployment on EC2 ephemeral disks:

1
2
# mdadm doesn't let you automate by default, so pipe in 'y'!
yes | mdadm ...