[rescue] The Machine Emulator (TME) on a Mac?

Mouse mouse at Rodents-Montreal.ORG
Wed May 7 21:12:02 CDT 2014


> 1) non-portable use of echo -n.

I'm not sure how fair it is to call this nonportable when every other
way to suppress the newline is also nonportable; the echos that take \c
generally don't take -n, and conversely.

Every way with echo, at least.  printf(1) makes this relatively easy.

> (on linux /bin/sh is the same thing as bash, [...])

This must be at least somewhat distro-dependent; I've recently been
subjected to Linux at work, and on that machine (Ubuntu of some stripe,
I think it is) sh and bash are different.  IIRC sh is ash.

> 2) non-portable use of character ranges with tr.  There are a number
> of places where a shell script needs to mash case and uses "tr a-z
> A-Z" instead of "tr [a-z] [A-Z]" and this falls down unless you have
> gnu tr.

Actually, you don't need GNU tr; BSD tr - or NetBSD tr at least - works
fine with that.  (Not that this is a reason to not change it, of
course; just pointing out that "unless you have gnu tr" is not actually
accurate.)

/~\ The ASCII				  Mouse
\ / Ribbon Campaign
 X  Against HTML		mouse at rodents-montreal.org
/ \ Email!	     7D C8 61 52 5D E7 2D 39  4E F1 31 3E E8 B3 27 4B


More information about the rescue mailing list