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


Click here to return to the 'No "space bar" goodness' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
No "space bar" goodness
Authored by: dmw on Jul 19, '10 07:39:08AM
Does it provide some other benefit that I'm just not seeing?
In this venue, you're right, it is overly complicated. Its one benefit over using read -n 1 is that it's technically more portable across UNIXs. On OS X, sh is really bash, which provides the -n option. The real sh doesn't have this option.

But since this is a Mac forum, and the script itself is Mac specific (using qlmanage), your method is preferable. And to be honest, I think it may be unlikely you'd find a modern UNIX variant where sh isn't really bash, so I think I'm going to retire this snippet in favor of yours. Thanks!

[ Reply to This | # ]