1 |
Alex Schuster <wonko@×××××××××.org> writes: |
2 |
|
3 |
> reader@×××××××.com writes: |
4 |
> |
5 |
>> So I'm interested in what I might run into. So far it looks like it |
6 |
>> would be ALMOST as easy as symlinking ksh to bash in /bin. |
7 |
> |
8 |
> Uh, this sounds scary :) |
9 |
|
10 |
Yeah, it would be on a system with actual users but here its just me, |
11 |
myself and I. So all that is effected are the ksh scripts I've |
12 |
written and currently use in various places (none are system show |
13 |
stoppers). |
14 |
|
15 |
But I was really just saying that syntax at my low level of usage is |
16 |
largely interchangeable but for the cases I mentioned. So it makes |
17 |
switching scripting shells from ksh93 to bash pretty smooth. |
18 |
|
19 |
|
20 |
[...] |
21 |
(for searchers who hit this discussion: I've snipped out very |
22 |
nice information showing how to do ksh93 style `set -A arrary cmd' |
23 |
in bash... and related interesting syntax See Alex S previous message |
24 |
in this thread at Message-ID: <200801141638.42281.wonko@×××××××××.org>) |
25 |
|
26 |
> I also had trouble with some bash bugs(*), and have some workarounds in my |
27 |
> scripts, in case they run with older bash versions. But as I cannot ensure |
28 |
> the client systems run kash or zsh, I did not bother to learn them, and |
29 |
> chose bash as my shell. It's amazing what it can do, but I guess zsh and |
30 |
> ksh can do the same, or even more. |
31 |
|
32 |
Pretty much summarizes why I'm switching to bash too. Instead of |
33 |
learning the suggested (in this thread) zsh or staying with ksh93. |
34 |
|
35 |
Something for your consideration I learned on comp.unix.shell that |
36 |
ksh93 can handle associative arrays where as bash cannot or maybe just |
37 |
not as easily. The example given by Icarus S. there for ksh93 was: |
38 |
|
39 |
From: Icarus Sparry <usenet@×××××××××××××.com> |
40 |
Subject: Re: internal alias |
41 |
Newsgroups: comp.unix.shell |
42 |
Date: 11 Jan 2008 17:23:20 GMT |
43 |
Message-ID: <4787a608$0$84193$742ec2ed@××××××××××.net> |
44 |
|
45 |
typeset -A wives |
46 |
wives["fred"]="wilma" |
47 |
wives["barny"]="betty" |
48 |
|
49 |
while read husband |
50 |
do |
51 |
case "${wives[$husband]}" in |
52 |
"") echo Single;; |
53 |
*) echo "Married to ${wives[$husband]}" ;; |
54 |
esac |
55 |
done |
56 |
|
57 |
You may find that discussion interesting |
58 |
|
59 |
> The other problem was with the =~ notation and quoting of the regular |
60 |
> expression not being allowed any more. Workaround is to define a variable |
61 |
> (foo) with the expression: [[ "blabla" =~ $foo ]] |
62 |
|
63 |
I can't reproduce that here (I mean a problem with quoting the regex) |
64 |
but maybe I'm not getting what you mean? Or maybe its been fixed. |
65 |
bash --version |
66 |
GNU bash, version 3.2.17(1)-release (i686-pc-linux-gnu) |
67 |
|
68 |
reader > if [[ "bla" =~ bl ]];then echo MATCH;fi |
69 |
MATCH |
70 |
|
71 |
reader > if [[ bla =~ "bl" ]];then echo MATCH;fi |
72 |
MATCH |
73 |
|
74 |
-- |
75 |
gentoo-user@l.g.o mailing list |