5,290 reputation
11726
bio website mikelward.com
location Mountain View, CA
age 34
visits member for 5 years, 2 months
seen Dec 12 at 15:17

Computer guy from Australia now living in the US.

Part sysadmin, part developer, part web developer.

My name is pronounced like "Michael".


Jan
19
answered is there any way to get into my nokia (3120 classic) without using nokia's software
Jan
19
comment Byzantine behaviour in shell script
Oops, you're right. But wow, that way of setting IFS looks even worse than IFS='<newline>' to me. :-)
Jan
19
answered Firefox 4 show tools menu in button interface
Jan
19
comment Byzantine behaviour in shell script
$'\n' comes from ksh93 AFAICT, and is also available in zsh and bash, but not dash. www2.research.att.com/sw/download/man/man1/ksh-man.html#Quoting
Jan
18
comment Byzantine behaviour in shell script
Don't type <ENTER>. Press the Enter key. :-) I edited my example above to show you.
Jan
18
revised Byzantine behaviour in shell script
add /bin/sh version
Jan
18
comment Byzantine behaviour in shell script
Yes, both Dennis's example and my example use $'\n'. If you are on Debian or Ubuntu, you have to change that to a literal newline (i.e. press Enter), because /bin/sh doesn't support that.
Jan
18
comment Byzantine behaviour in shell script
Yes, I'm guessing rm -i reads from stdin, which is supplied by the heredoc, rather than from /dev/tty.
Jan
18
comment Byzantine behaviour in shell script
If you're not using bash, you have to replace IFS=$'\n' with IFS='<ENTER>'.
Jan
18
revised Byzantine behaviour in shell script
added 8 characters in body
Jan
18
comment Byzantine behaviour in shell script
I said use set -x because he was using the -x option. For consistency and because I think the set -<flag> form is more common than set -o <optname>.
Jan
18
comment Byzantine behaviour in shell script
He said he was using bash. This allows me to say use echo -e. Otherwise you really need printf for consistent behavior on all platforms, but that's an external command in bash, so echo -e is correct and faster in this case.
Jan
18
revised Byzantine behaviour in shell script
added 369 characters in body
Jan
18
comment Byzantine behaviour in shell script
+1. Tilde definitely needs escaping. Also agree there would be simpler ways to write this.
Jan
18
answered Byzantine behaviour in shell script
Jan
18
comment Ubuntu: Linux can browse sites, bash can't even resolve the dns name - Huh!
Yes, hence the question. :-)
Jan
18
answered Ubuntu: Linux can browse sites, bash can't even resolve the dns name - Huh!
Jan
18
answered Firefox 4 show tools menu in button interface
Jan
18
comment is it possible to open a new shell from a shell and switch between them?
@honk Thanks. Online man pages didn't mention suspend, but indeed it's there in bash 3.2. gnu.org/software/bash/manual/html_node/Bash-Builtins.html
Jan
18
answered is it possible to open a new shell from a shell and switch between them?