🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

3 total messages Started by Scott Weikart Thu, 30 Jul 1992 20:48
Differences between bash-1.12 and ksh88
#244
Author: Scott Weikart
Date: Thu, 30 Jul 1992 20:48
37 lines
1962 bytes
I've only been reading this newsgroup for a while, because only recently did I
start using bash (now I use it on all my machines, it's great!).  So this
question has perhaps been discussed before.

Does anyone have a list of incompatibilities between bash and the 1988 version
of ksh?  I'm mostly interested in the differences that are a problem for shell
script programmers (I've been writing probably 500 lines/month of ksh for the
last four years).  Here's my current list of problematic bash-1.12
differences:

   1) set options aren't local to a function

   2) doesn't support -L -R -Z -l -u args to typeset

   3) 'typeset -i i ; [ i=i+1 -gt 0 ]' doesn't work as expected

   4) doesn't support (( )), only let and typeset -i

   5) $(< file) doesn't work

   6) 'ENV_VAR=temp_value foo foo_args' doesn't work if foo is a shell function

   7) doesn't have a print command with the various options

   8) typeset -i foo=0123 will store 83 into foo (i.e. leading 0 means octal)

These are listed in rough order of inverse importance, with 1 and 2 being the
most problematic.

By the way, I'd care less about the typeset options (except for -l and -u) if
there were a printf builtin (which would seem easy to implement).  I use the
'printf' command I got off Usenet at times, but usually I don't want to expend
the exec.

Scott Weikart			Community Data Processing (CdP): 415-322-9069
Internet: scott@igc.org		Bitnet: scott%igc.org@stanford
UUCP Mail Net: uunet!cdp!scott
Re: Differences between bash-1.12 and ksh88
#253
Author: bruce draper
Date: Mon, 03 Aug 1992 21:47
28 lines
1403 bytes
bash-1.12

-- doesn't support 
	[[  ]]

-- doesn't support an expression shift count, i.e.
	shift 3-1
   and what's worse, bash is silent about it :-(

-- doesn't allow for for more than one argument to "-f", "-r", etc. in test, i.e.
	[ -f f0 f1 ]

these last two are arguably sloppiness in ksh that ought not to work.

i've spent a fair amount of time converting ksh scripts to bash (altho
i hadn't discovered your entire list :-) and while i miss the c-ish 
syntax and semantics of [[ ]], esp. the short circuit evaluation, i figure
it's time well spent.   ksh just isn't available everywhere while bash
is quite the traveller.



bruce

-- 
bruce draper              | "just because we make it is no reason for me to
bruce@blazin.dsg.dec.com  |  refrain from observing the emperor has no clothes"
draper@royalt.enet.dec.com|                      -- me
Re: Differences between bash-1.12 and ksh88
#261
Author: Noah Friedman
Date: Tue, 04 Aug 1992 20:30
13 lines
924 bytes
In article <1992Aug3.214728.7399@nntpd.lkg.dec.com> bruce@blazin.dsg.dec.com (bruce draper) writes:
>bash-1.12
>
>-- doesn't support an expression shift count, i.e.
>        shift 3-1
>   and what's worse, bash is silent about it :-(

   It shouldn't be silent.  However, the functionality does exist in a
slightly different form:

        shift $[ 3-1 ]

Read the man page about the "$[ ... ]" feature. 
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads