Bourne Shell compatible shells (was: Request: which shells)

Bourne Shell compatible shells (was: Request: which shells)

Post by Arjan de V » Sun, 18 Apr 1993 09:00:15




Quote:Jung) writes:
>which shells are available for Linux
>I am particular interested in bourne shell compatibles..

Me too :-)

Quote:>I just found one drawback of bash on linux:
>The make depend from Smail 3.1.28 was doing nonsense .
>checking the sh scripts I found the problem to set the CASE_NO_NEWLINES

>the bash was not able to work with newlines in arguments inside a case
>switch...

I also had some problems with smail and make depend. Don't remember how I
fixed them.

I also detected two other problems with bash 1.12:

 - it wouldn't run the Configure script of trn 3.0 (beta). This will be
   fixed in bash 1.13, but the Configure script has already changed so that
   it works with bash 1.12 too.

 - it does something wrong with passing $* from other shell scripts which are
   included by the `.' command. I detected this when INN 1.4 rejected all
   newgroup messages.

Quote:>ksh blew on some other kind, it just hang at one place or was that
>awfully slower than bash.

The pdksh I have (4.7) is absolutely unuseable for running Configure
scripts. Try the following script with pdksh 4.7 with two or more parameters:

        #!/bin/ksh

Zsh gives also problems with Configure scripts.

Quote:>What shells are available for linux and which type they are.
>I know of: bash, ksh, tcsh, zsh.
>I know bas is some how bourne shell compatible
>tcsh somehow csh and ksh also sh..

I use tcsh as interactive shell and bash as /bin/sh substitute because bash
is the more-or-less Bourne shell compatible shell which runs most of the
(Configure) scripts I have.  Running Configure scripts (sometimes >100Kb) is
a real good test for testing /bin/sh compatibility of shells.

Arjan

--


 
 
 

Bourne Shell compatible shells (was: Request: which shells)

Post by Arjan de V » Sun, 18 Apr 1993 19:58:43



writes:

>The pdksh I have (4.7) is absolutely unuseable for running Configure
>scripts. Try the following script with pdksh 4.7 with two or more parameters:

>    #!/bin/ksh


The bug has been fixed in pdksh 4.8. Maybe I'll give pdksh another try...

Arjan

--



 
 
 

Bourne Shell compatible shells (was: Request: which shells)

Post by HJ L » Mon, 19 Apr 1993 01:20:47



>The pdksh I have (4.7) is absolutely unuseable for running Configure
>scripts. Try the following script with pdksh 4.7 with two or more parameters:

>    #!/bin/ksh


I will make my pdksh 4.8 available in source code when I get time. I
fixed two bugs. There is still one bug hard to fix. That is

if [ -s foo -a "`cat foo`" = "FOO" ]; then
....

If foo doesn't exist, pdksh still do cat foo since it evaluates
`cat foo` first before everything else.

H.J.

 
 
 

Bourne Shell compatible shells (was: Request: which shells)

Post by Bas de Bakk » Thu, 22 Apr 1993 06:54:18


hl> I will make my pdksh 4.8 available in source code when I get time. I
hl> fixed two bugs. There is still one bug hard to fix. That is

hl> if [ -s foo -a "`cat foo`" = "FOO" ]; then
hl> ....

hl> If foo doesn't exist, pdksh still do cat foo since it evaluates
hl> `cat foo` first before everything else.

I wouldn't call this a bug. In fact, I would call the behaviour you
desire a bug. If it doesn't parse the backquotes in the second
argument if the first one is false, how could this ever be compatible
with an external /bin/test ?

Bas.

 
 
 

1. Light Speed Bourne Shell! (was: Bourne shell tricks)

                              WARP SPEED TESTS!

For a light-speed bourne shell script, I just found out a really cool trick:
        if [ "$var" = "condition" ]; then list; fi
becomes:
        case "$var" in "condition") list;; esac

Take this example, two scripts:
        if.sh:
                for x in `jot 1000`; do
                        if [ $x = 1000 ]; then echo "Done"; fi
                        done
        case.sh:
                for x in `jot 1000`; do
                        case $x in 1000) echo "Done";; esac
                        done

("jot" is just some weird util we have here that prints out numbers)
Now take a look at the runtimes (on a DECstation/240 with not much load):
#0 /tmp/JAMtmp> time sh case.sh
                real    0m0.53s
                user    0m0.11s
                sys     0m0.05s
#0 /tmp/JAMtmp> time sh if.sh  
 ^--return code of last cmd in prompt ;-)
                real    0m32.43s
                user    0m1.95s
                sys     0m16.80s
So, case instead of test is:
real:   61 times faster
user:   18 times faster
sys :   31 times faster

...So use case instead of if whenever you can! (just remember the case will
interpret your condition as a pattern!)

--

  n  r    
  a JAMax  "Thou shalt not kill...  Thou shalt not steal...
  h o   w   Thou shalt not covet thy neighbour's...ass nor any
  tan lle   thing that is thy neighbour's."  --Bible

2. Having problems with FTP! HELP PLEASE!!

3. Changing from the Bourne shell to C-shell

4. http multipart response in java through apache

5. Trying to run nohup from Korn shell but getting Bourne shell errors

6. followsymlinks off for CERN server

7. Bourne Shell vs C-Shell

8. cconv charset convertor?

9. signature of the Bourne shell and the C shell

10. Process history under C-shell and Bourne shell

11. Telling Bourne shell from Korn shell at start-up

12. Bourne shell script to determine users shell

13. Running a Bourne Shell daemon from a C shell(HELP?)