Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

read | 16 comments | Create New Account
Click here to return to the 'read' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Authored by: gidds on Jul 06, '10 12:54:36PM

What does this do that the shell built-in read doesn't? A simple

read -s VAR

seems a good deal simpler than a mess of Perl.

(The -s flag puts it in silent (noecho) mode; other options let you show a prompt, time out, etc. It's available in sh, bash, zsh etc.)

And, as other posters have mentioned, if the result's going on a command line then it doesn't matter how you construct it, coz ps or top will see it anyway...


[ Reply to This | # ]
Authored by: SOX on Jul 06, '10 02:02:53PM

Well for one reason not to use read is that it does nothing from the command line.
% read foxhole
% echo $foxhole
foxhole: Undefined variable.

[ Reply to This | # ]
Authored by: efge on Jul 07, '10 01:55:56PM

You are wrong, this works perfectly well.

[ Reply to This | # ]