public inbox for gentoo-user@lists.gentoo.org
 help / color / mirror / Atom feed
From: reader@newsguy.com
To: gentoo-user@lists.gentoo.org
Subject: [gentoo-user]  Re: emerge of ksh93 erroring out.. who can interpret
Date: Mon, 14 Jan 2008 11:20:33 -0600	[thread overview]
Message-ID: <87tzlg2uji.fsf@newsguy.com> (raw)
In-Reply-To: 200801141638.42281.wonko@wonkology.org

Alex Schuster <wonko@wonkology.org> writes:

> reader@newsguy.com 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: <200801141638.42281.wonko@wonkology.org>)

> 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 <usenet@icarus.freeuk.com>
   Subject: Re: internal alias
   Newsgroups: comp.unix.shell
   Date: 11 Jan 2008 17:23:20 GMT
   Message-ID: <4787a608$0$84193$742ec2ed@news.sonic.net>
  
   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	other threads:[~2008-01-14 17:21 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-01-07 20:52 [gentoo-user] emerge of ksh93 erroring out.. who can interpret Harry Putnam
2008-01-08  9:39 ` Alan McKinnon
2008-01-09  2:32   ` [gentoo-user] " reader
2008-01-10 19:34     ` Matthias B.
2008-01-11 17:18       ` reader
2008-01-11 18:26         ` Matthias B.
2008-01-11 18:56           ` reader
2008-01-11 21:41             ` Matthias B.
2008-01-14 15:38             ` Alex Schuster
2008-01-14 17:20               ` reader [this message]
2008-01-14 19:22                 ` Alex Schuster

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87tzlg2uji.fsf@newsguy.com \
    --to=reader@newsguy.com \
    --cc=gentoo-user@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox