What does “stty raw -echo” do on OS X

Firstly, the dash means “disable” a setting. So this enables echoing: stty echo This disables it: stty -echo When you disable it, your typing is not echoed back to you, which is why it seems as if the terminal is hanging. Try stty -echo then type ls and press return – you will still see … Read more

How do I connect to a websocket manually, with netcat/socat/telnet?

I think you want to modify the socket stream to translate \n (line feed) to CRLF (Carriage return & line feed). Doing info socat produces detailed information which includes this modifier: crnl Converts the default line termination character NL (‘\n’, 0x0a) to/from CRNL (“\r\n”, 0x0d0a) when writing/reading on this chan- nel (example). Note: socat simply … Read more

lambda functions in bash

I don’t know of a way to do this, however you may be able to accomplish what you’re trying to do using: somecommand | while read -r; do echo “Something with $REPLY”; done This will also be faster, as you won’t be creating a new process for each line of text. [EDIT 2009-07-09] I’ve made … Read more

Pass empty variable in bash

On the first case you call the script with testFunct param2. Hence, it understands param2 as the first parameter. It is always recommendable to pass parameters within quotes to avoid this (and to be honest, for me it is cleaner this way). So you can call it testFunct “$param1” “$param2” So to pass an empty … Read more