Alex Schuster <[EMAIL PROTECTED]> writes:

> [EMAIL PROTECTED] writes:
>
>> So I'm interested in what I might run into.  So far it looks like it
>> would be ALMOST as easy as symlinking ksh to bash in /bin.
>
> Uh, this sounds scary :)

Yeah, it would be on a system with actual users but here its just me,
myself and I.  So all that is effected are the ksh scripts I've
written and currently use in various places (none are system show
stoppers). 

But I was really just saying that syntax at my low level of usage is
largely interchangeable but for the cases I mentioned.  So it makes
switching scripting shells from ksh93 to bash pretty smooth.


[...] 
(for searchers who hit this discussion: I've snipped out very
nice information showing how to do ksh93 style `set -A arrary cmd'
in bash... and related interesting syntax See Alex S previous message
in this thread at Message-ID: <[EMAIL PROTECTED]>)

> I also had trouble with some bash bugs(*), and have some workarounds in my 
> scripts, in case they run with older bash versions. But as I cannot ensure 
> the client systems run kash or zsh, I did not bother to learn them, and 
> chose bash as my shell. It's amazing what it can do, but I guess zsh and 
> ksh can do the same, or even more.

Pretty much summarizes why I'm switching to bash too.  Instead of
learning the suggested (in this thread) zsh or staying with ksh93.

Something for your consideration I learned on comp.unix.shell that
ksh93 can handle associative arrays where as bash cannot or maybe just
not as easily.  The example given by Icarus S. there for ksh93 was:

   From: Icarus Sparry <[EMAIL PROTECTED]>
   Subject: Re: internal alias
   Newsgroups: comp.unix.shell
   Date: 11 Jan 2008 17:23:20 GMT
   Message-ID: <[EMAIL PROTECTED]>
  
   typeset -A wives
   wives["fred"]="wilma"
   wives["barny"]="betty"
   
   while read husband
   do
    case "${wives[$husband]}" in
    "") echo Single;;
    *) echo "Married to ${wives[$husband]}" ;;
    esac
   done
  
You may find that discussion interesting

> The other problem was with the =~ notation and quoting of the regular 
> expression not being allowed any more. Workaround is to define a variable 
> (foo) with the expression: [[ "blabla" =~ $foo ]]

I can't reproduce that here (I mean a problem with quoting the regex)
but maybe I'm not getting what you mean? Or maybe its been fixed.
 bash --version
GNU bash, version 3.2.17(1)-release (i686-pc-linux-gnu)

  reader > if [[ "bla" =~ bl ]];then echo MATCH;fi 
  MATCH

  reader > if [[ bla =~ "bl" ]];then echo MATCH;fi 
  MATCH

-- 
gentoo-user@lists.gentoo.org mailing list

Reply via email to