Will using “yes” command waste lot of cpu cycles ?
I have a long running script (script code not in my control) which accepts something as input just once. Then the script runs for long time .
To automate I use “yes” command to feed the input
yes hello | myscript
Will yes command steal/waste lot of cpu cycles ?. As per the docs i read it keeps printing the string argument to piped program
I gave top command , i didnt see “yes” there in top
yeswill print the string “hello” when it has the chance – this means that the receiving end (your script) must be waiting for I/O (i.e., expecting input). So: no,yesdoes not take any CPU when the receiving end does not wait for input, the process is blocked.See the run state of the process
yesin aps auxffor confirmation.