[geeks] Thoughts? (Cheap NAS with nice feature set)
Sandwich Maker
adh at an.bradford.ma.us
Mon Apr 7 17:52:22 CDT 2008
" From: Joshua Boyd <jdboyd at jdboyd.net>
"
" On Fri, Apr 04, 2008 at 06:30:42PM -0400, Sandwich Maker wrote:
" > " From: Joshua Boyd <jdboyd at jdboyd.net>
" > "
" > "
" > " Bash is standard now, which I like.
" >
" > just curious - what does bash do for you that ksh doesn't?
"
" I don't know. I just know that the default of /bin/sh doesn't cut it
" for me (and maybe /bin/sh is a ksh that uses argv[0] to change its
" behavior, but if so I don't really care).
on solaris /bin/sh is still the old bourne shell, but one of the
things hp-ux definitely got right was throwing the POSIX compile-time
switch on ksh88 and installing the result as /bin/sh [0]. makes it
easy to get ksh-y goodness for root without monkey-motion like
duplicate accounts or checking for interactivity.
" Most of the shell scripting I know will work on either sh or bash, but I
" like things like emacsish key bindings (^A, ^E, M-f, M-w, etc),
" searching through the command history with C-r, and being able to use
" the up and down arrows to go through the history.
ksh can do this, with a 'set -o emacs' in your $ENV file. one of the
reasons i converted to ksh was 'set -o vi'. the other was the ability
to eval PS1 dynamically, so that i could have it set my icon labels
with HOSTNAME and titlebars with USER at HOSTNAME:PWD. the prompt that
shows on my cmdline is just a bold cmdhist number and ':' [or '#' for
root], and ksh is smart enough to look for CR chars in PS1 when
counting its length.
" From: Michael Parson <mparson at bl.org>
"
" On Fri, 4 Apr 2008, Sandwich Maker wrote:
"
" > " From: Joshua Boyd <jdboyd at jdboyd.net>
" > "
" > "
" > " Bash is standard now, which I like.
" >
" > just curious - what does bash do for you that ksh doesn't?
"
" Since bash 3.0:
"
" printf '%02d\n' {1..10}
<sigh>
ksh88 src has in addition to POSIX [which iirc changes the behavior of
only about 6 things [1]], BRACEPAT and FLOAT compile switches. they
are off by default, but i successfully used them back around '90 when
i worked for attbl and had access to src. i really don't understand
why they aren't on by default, unless it's 'we've always done it this
way'...
BRACEPAT is what you'd expect. FLOAT allows floating-point shell
arithmetic, eg.
691: print $((3.4*4.5))
15.3
there were some other interesting options too, like FS_3D, added in
for nmake's VPATH...
" Mostly, I prefer the interactive features of bash over ksh. For
" scripting, most of what I do can be done just fine in ksh, but there are
" a few features (like the brace expansion example above) that I do like
" in newer versions of bash.
ksh93, which you can d/l for free from research.att.com, has POSIX,
BRACEPAT, and an even better FLOAT behavior turned on by default.
okay, it's not built in... but it is, if you have cde; dtksh is based
on ksh93 - try ESC-^V in vi-mode. this is true for at least cde on
solaris and hp-ux, which makes me think cde on aix and irix [did
they?] would have it too.
[0] it's possible that hp made it dynamic and $0-based and link one
binary to both /bin/sh and [/usr]/bin/ksh. i haven't seen a hp-ux
system in about 10y but i vaguely recall something like this from the
manpgs.
[1] the only one i recall was the val of $0 in functions. posix says
that $0 shall be the name of the shell at all times - but it also only
specifies -one- way to define a function whereas ksh has always had
-two-, so the other still retains the old behavior of setting $0 to
funcname.
just recalled another - when setting shell limits, 4194344 [2^32] was
replaced by the special token 'maxint', which caused us no end of
grief when users tried to run cron or at jobs under ksh; hp-ux 10.20
cron expected posix sh. ksh doesn't recognize 'maxint' while posix
sh doesn't recognize 4194344 in that context. we finally found the
cronjob limits-setting script we could hack a $0/$SHELL check into.
we filed a cron bug, but i left that contract before i heard if they
fixed it.
________________________________________________________________________
Andrew Hay the genius nature
internet rambler is to see what all have seen
adh at an.bradford.ma.us and think what none thought
More information about the geeks
mailing list