5 ms·
One consequence of "the rule of silence" is that sometimes it is not obvious if a command is processing data or waiting for input, there is no visual difference
by augustk 10y ago
One consequence of "the rule of silence" is that sometimes it is not obvious if a command is processing data or waiting for input, there is no visual difference.
- pwdisswordfish 10y agoYou can often just check by hitting ^D, but yes, this is a workaround, not a fix.
- ddalex 10y agoThis is why well-behaved programs prompt for input. Like bash, e.g.
- bluetomcat 10y agoWith cat being the notable exception :-)
- marcosdumay 10y agoAnd grep. Programs that use the input and output to carry data around can not show prompts to the user.
- athenot 10y agoA workaround is to prompt on STDERR. Data input will enter the same place, and output will be distinguished from the text for prompts.
- laumars 10y agoThat's more an occasional annoyance than a real problem though. The only commands that don't prompt when waiting for input are commands that are written specifically for stream processing from stdin. In which case the user should already be aware of it's behaviour because they're either already familiar with the command or have have consulted it's man page (or similar reference) before executing it. So the unprompted waiting for using input is a bug in a shell script / command line pipe and thus usually pretty quick to debug. Going back to the man page point: I will granted you that not everyone does check what a program does before running it. Sadly in those instances there's little you can do to protect them from themselves. It's similar to how you cannot protect people from blindly copying and pasting code from the internet. If someone is willing to run a command "blind" then the usefulness of the output is the least of their worries.
- pharrlax 10y agoOr if it has failed silently.