[PATCH v2] sotruss: convert from ksh to bash

Mike Frysinger vapier@gentoo.org
Thu Mar 13 22:50:00 GMT 2014


On Thu 13 Mar 2014 15:30:05 Roland McGrath wrote:
> > This script works fine under bash (which we already require), so tweak
> > the code to be pure bash.
> 
> I don't think we've documented anywhere that our installed scripts require
> bash.  Some of them already do, so this is not something you're changing
> here.  But before "we already require foo" should generally be considered
> an adequate rationale for a change by itself, it should be a requirement
> that we have made explicit and documented, rather than just a de facto
> requirement that might have snuck in without clear intent.

sotruss itself doesn't work if you don't have bash or ksh.  so what i am 
changing is that ksh is no longer supported.

afaict, the only reason bash is required is for localization of the messages.  
but even that works w/POSIX shell, albeit with slightly funky display -- you 
get a literal $ in the output of each string.

> I also think the changes to the script are fine, but they are purely
> cosmetic and wholly unnecessary.  Your "pure bash" and "to match bash"
> comments seem to imply that "function foo {" style is somehow less
> supported by bash than "foo() {", which AFAIK has never been the case.

true, the current code works under bash unmodified.  really i'm fixing the 
code to be portable to pretty much any shell.  force of habit that i see this 
style and think "that's not valid".

so i guess i'll rewrite this to say "drop ksh support and add basic support 
for any POSIX shell".
-mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part.
URL: <http://sourceware.org/pipermail/libc-alpha/attachments/20140313/90557646/attachment.sig>


More information about the Libc-alpha mailing list