bash -> ksh HOWTO?

bash -> ksh HOWTO?

am 10.10.2007 15:37:08 von Matej Cepl

Hi,

is there something like %subj%? I would be interested in trying
ksh, but I get lost really fast. Is there some document how to
live in ksh when one knows only bash?

Matěj

Re: bash -> ksh HOWTO?

am 10.10.2007 17:13:19 von Icarus Sparry

On Wed, 10 Oct 2007 15:37:08 +0200, Matej Cepl wrote:

> Hi,
>
> is there something like %subj%? I would be interested in trying ksh, but
> I get lost really fast. Is there some document how to live in ksh when
> one knows only bash?
>
> Matěj

Would you care to be more specific? Are you using it for programming or
interactive? What sorts of things can you do in bash that you can not do
in ksh?

It might be that all you need to know is to type "set -o emacs".

Which version of ksh are you using?

Re: bash -> ksh HOWTO?

am 10.10.2007 22:13:40 von cfajohnson

On 2007-10-10, Matej Cepl wrote:
>
> is there something like %subj%? I would be interested in trying
> ksh, but I get lost really fast. Is there some document how to
> live in ksh when one knows only bash?

If you write your bash scripts using portable (i.e., POSIX) syntax,
the scripts will run just as well in ksh.

Many of the extensions in bash are also in ksh93, so those will not
need changing.

--
Chris F.A. Johnson, author
Shell Scripting Recipes: A Problem-Solution Approach (2005, Apress)
===== My code in this post, if any, assumes the POSIX locale
===== and is released under the GNU General Public Licence

Re: bash -> ksh HOWTO?

am 10.10.2007 22:44:41 von Matej Cepl

On 2007-10-10, 15:13 GMT, Icarus Sparry wrote:
> It might be that all you need to know is to type "set -o
> emacs".

Yes, that's probably what is absolutely necessary and which makes
me able to survive. Other, more precise question will certainly
follow. Just for the record, it is ksh-20070628-1.1.fc8 on Fedora
8 (aka Fedora Rawhide).

Matěj

Re: bash -> ksh HOWTO?

am 10.10.2007 22:45:03 von Matej Cepl

On 2007-10-10, 15:13 GMT, Icarus Sparry wrote:
> It might be that all you need to know is to type "set -o
> emacs".

And of course, thanks for replying.

Matěj

Re: bash -> ksh HOWTO?

am 11.10.2007 12:44:27 von Aleksey Cheusov

> Hi,

> is there something like %subj%? I would be interested in trying
> ksh, but I get lost really fast. Is there some document how to
> live in ksh when one knows only bash?

case $- in
*i*)
set -o vi-tabcomplete
set -o emacs
set -o ignoreeof
set -o braceexpand

bind '^I=complete-list'
bind '^[OH'=beginning-of-line
bind '^[OF'=end-of-line
bind '^[[3'=prefix-2
bind '^[[3~'=delete-char-forward
;;
esac

--
Best regards, Aleksey Cheusov.