Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is the program `yes` used for anything significant?

Tags:

linux

unix

When I first came across the yes program in *nix I couldn't think of a significant use for it.

How is this program used?

like image 238
OregonTrail Avatar asked Dec 07 '11 14:12

OregonTrail


People also ask

What do you know about the YES program?

YES is a merit-based scholarship for high school students aged 15-17 to spend one academic year in the United States living with an American host family, attending high school, acquiring leadership skills, and helping educate Americans about their home country and culture.

Who founded YES program?

The Kennedy-Lugar YES program was established by Congress in October 2002 in response to the events of September 11, 2001. Since then, YES has expanded to 37 countries, impacting over 13,000 students.

Where did you learn about YES program?

Online registration and information about the YES program is available at https://afsindonesia.org/yes-program/. Selections are done in 20 Chapters. Only selected finalists will be invited to participate in the National Selection Camp.

What is the YES program Idaho?

Youth Empowerment Services (YES) is the mental health system of care in Idaho for children with serious emotional disturbance (SED) — a term used to identify children under the age of 18 who have both a mental health diagnosis and a functional impairment.


2 Answers

yes is meant to automate interactive programs that want confirmation before taking action.

yes | rm -ri foo

is roughly equivalent to

rm -rf foo

The difference is that -f will also proceed in case of failure.

like image 177
Fred Foo Avatar answered Sep 17 '22 12:09

Fred Foo


Another one may be quickly adding n lines of the same text to a file:

 yes "this is the text I want to add to a file"|head -200>myFile.txt

which creates a file with 200 lines of the same text.

like image 44
Kent Avatar answered Sep 19 '22 12:09

Kent