Discussion:
[ast-developers] latest ast beta source posted
David Korn
2014-06-27 19:40:04 UTC
Permalink
We have posted the latest ast beta source packages. I have been working on
trying to provide a bash compatibility mode and have added a number of new
features to ksh93 itself. When the ksh is liked and run as bash, several
bash features are enabled and
bash rc files are processed.

One of the major new additions, is programmable tab completion with the
editor which is enabled in both bash mode and ksh mode. Since this is
complex and has little automatic testing, I would appreciated any feedback.
I am sure that I missed a few things.

There are many other additions. Read the RELEASE file in src/cmd/ksh93 for
more
information.

We would like to get an official release in 3Q14.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.research.att.com/pipermail/ast-developers/attachments/20140627/72de06be/attachment.html>
David Korn
2014-06-30 18:36:25 UTC
Permalink
I don't know if this got through so I am resending:

We have posted the latest ast beta source packages. I have been working on
trying to provide a bash compatibility mode and have added a number of new
features to ksh93 itself. When the ksh is liked and run as bash, several
bash features are enabled and
bash rc files are processed.

One of the major new additions, is programmable tab completion with the
editor which is enabled in both bash mode and ksh mode. Since this is
complex and has little automatic testing, I would appreciated any feedback.
I am sure that I missed a few things.

There are many other additions. Read the RELEASE file in src/cmd/ksh93 for
more
information.

We would like to get an official release in 3Q14.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.research.att.com/pipermail/ast-developers/attachments/20140630/9d5ed707/attachment.html>
Dan Douglas
2014-07-04 23:33:23 UTC
Permalink
"FUNCNAME" might be good to have because it's related to "BASH_SOURCE" in a
similar manner as ".sh.fun" and ".sh.file".

I tried implementing FUNCNAME using the debugger. The trouble is expanding
"${FUNCNAME[@]}". The hack on the last line makes it sort-of work by pushing
new elements on the end during expansion, but then it can't shrink.

function FUNCNAME.get {
nameref self=${.sh.name}
if (( .sh.subscript < .sh.level )); then
trap "(( .sh.level -= .sh.subscript + 1 )); eval '(( .sh.level = ${.sh.level} ))' \; _=\${.sh.fun}" DEBUG
trap - DEBUG;
fi

(( .sh.subscript < .sh.level - 2 )) && self[.sh.subscript + 1]=
}

Still lots of goodies in RELEASE I've yet to play with.
--
Dan Douglas
Danny Weldon
2014-07-10 03:07:28 UTC
Permalink
I had these errors when I tried out completion on Ubuntu 12.04.4 LTS.

It typed "git he" and pressed tab to see if it would complete the word "help":


$ ./bash -l
bash: warning: shell level (5404176) too high, resetting to 1
danny at danny-ubuntu ~/wrk/ksh/ast-ksh.2014-06-25/arch/linux.i386-64/bin
$ git he<tab>

This is what happens next (btw, it backspaced over the 'e'):

$ git hbash: _upvars: cword: invalid option
./bash: _git[22803]: compgen[3]: add: not found [No such file or directory]
./bash: _git[22803]: compgen[4]: get-tar-commit-id: not found [No such
file or directory]
./bash: _git[22803]: compgen[5]: reflog: not found [No such file or directory]
./bash: _git[22803]: grep: no pattern
./bash: _git[22803]: compgen[7]: relink: not found [No such file or directory]
./bash: _git[22803]: compgen[8]: am: not found [No such file or directory]
./bash: _git[22803]: compgen[9]: gui: not found [No such file or directory]
./bash: _git[22803]: compgen[10]: remote: not found [No such file or directory]
./bash: _git[22803]: compgen[11]: annotate: not found [No such file or
directory]
./bash: _git[22803]: compgen[12]: apply: not found [No such file or directory]

(Many more similar errors after this)
Post by Dan Douglas
"FUNCNAME" might be good to have because it's related to "BASH_SOURCE" in a
similar manner as ".sh.fun" and ".sh.file".
I tried implementing FUNCNAME using the debugger. The trouble is expanding
new elements on the end during expansion, but then it can't shrink.
function FUNCNAME.get {
nameref self=${.sh.name}
if (( .sh.subscript < .sh.level )); then
trap "(( .sh.level -= .sh.subscript + 1 )); eval '(( .sh.level = ${.sh.level} ))' \; _=\${.sh.fun}" DEBUG
trap - DEBUG;
fi
(( .sh.subscript < .sh.level - 2 )) && self[.sh.subscript + 1]=
}
Still lots of goodies in RELEASE I've yet to play with.
--
Dan Douglas
_______________________________________________
ast-developers mailing list
ast-developers at lists.research.att.com
http://lists.research.att.com/mailman/listinfo/ast-developers
--
Regards

Danny
David Korn
2014-07-10 03:36:51 UTC
Permalink
Did you link ksh93 to bash and run this version of bash? ksh93 has to
emulate bash to be able to run the bash functions since there are a few
incompatibilities.


On Wed, Jul 9, 2014 at 11:07 PM, Danny Weldon <danny.weldon at gmail.com>
Post by Danny Weldon
I had these errors when I tried out completion on Ubuntu 12.04.4 LTS.
$ ./bash -l
bash: warning: shell level (5404176) too high, resetting to 1
danny at danny-ubuntu ~/wrk/ksh/ast-ksh.2014-06-25/arch/linux.i386-64/bin
$ git he<tab>
$ git hbash: _upvars: cword: invalid option
./bash: _git[22803]: compgen[3]: add: not found [No such file or directory]
./bash: _git[22803]: compgen[4]: get-tar-commit-id: not found [No such
file or directory]
./bash: _git[22803]: compgen[5]: reflog: not found [No such file or directory]
./bash: _git[22803]: grep: no pattern
./bash: _git[22803]: compgen[7]: relink: not found [No such file or directory]
./bash: _git[22803]: compgen[8]: am: not found [No such file or directory]
./bash: _git[22803]: compgen[9]: gui: not found [No such file or directory]
./bash: _git[22803]: compgen[10]: remote: not found [No such file or directory]
./bash: _git[22803]: compgen[11]: annotate: not found [No such file or
directory]
./bash: _git[22803]: compgen[12]: apply: not found [No such file or directory]
(Many more similar errors after this)
Post by Dan Douglas
"FUNCNAME" might be good to have because it's related to "BASH_SOURCE"
in a
Post by Dan Douglas
similar manner as ".sh.fun" and ".sh.file".
I tried implementing FUNCNAME using the debugger. The trouble is
expanding
pushing
Post by Dan Douglas
new elements on the end during expansion, but then it can't shrink.
function FUNCNAME.get {
nameref self=${.sh.name}
if (( .sh.subscript < .sh.level )); then
trap "(( .sh.level -= .sh.subscript + 1 )); eval '(( .sh.level =
${.sh.level} ))' \; _=\${.sh.fun}" DEBUG
Post by Dan Douglas
trap - DEBUG;
fi
(( .sh.subscript < .sh.level - 2 )) && self[.sh.subscript + 1]=
}
Still lots of goodies in RELEASE I've yet to play with.
--
Dan Douglas
_______________________________________________
ast-developers mailing list
ast-developers at lists.research.att.com
http://lists.research.att.com/mailman/listinfo/ast-developers
--
Regards
Danny
_______________________________________________
ast-developers mailing list
ast-developers at lists.research.att.com
http://lists.research.att.com/mailman/listinfo/ast-developers
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.research.att.com/pipermail/ast-developers/attachments/20140709/2e638f85/attachment.html>
Danny Weldon
2014-07-10 03:46:28 UTC
Permalink
I think it created the hard link itself:

danny at danny-ubuntu ~/wrk/ksh/ast-ksh.2014-06-25/arch/linux.i386-64/bin
$ ls -li bash ksh
934962 -rwxrwxr-x 2 danny danny 1984736 Jul 1 10:32 bash
934962 -rwxrwxr-x 2 danny danny 1984736 Jul 1 10:32 ksh
Post by David Korn
Did you link ksh93 to bash and run this version of bash? ksh93 has to
emulate bash to be able to run the bash functions since there are a few
incompatibilities.
On Wed, Jul 9, 2014 at 11:07 PM, Danny Weldon <danny.weldon at gmail.com>
Post by Danny Weldon
I had these errors when I tried out completion on Ubuntu 12.04.4 LTS.
$ ./bash -l
bash: warning: shell level (5404176) too high, resetting to 1
danny at danny-ubuntu ~/wrk/ksh/ast-ksh.2014-06-25/arch/linux.i386-64/bin
$ git he<tab>
$ git hbash: _upvars: cword: invalid option
./bash: _git[22803]: compgen[3]: add: not found [No such file or directory]
./bash: _git[22803]: compgen[4]: get-tar-commit-id: not found [No such
file or directory]
./bash: _git[22803]: compgen[5]: reflog: not found [No such file or directory]
./bash: _git[22803]: grep: no pattern
./bash: _git[22803]: compgen[7]: relink: not found [No such file or directory]
./bash: _git[22803]: compgen[8]: am: not found [No such file or directory]
./bash: _git[22803]: compgen[9]: gui: not found [No such file or directory]
./bash: _git[22803]: compgen[10]: remote: not found [No such file or directory]
./bash: _git[22803]: compgen[11]: annotate: not found [No such file or
directory]
./bash: _git[22803]: compgen[12]: apply: not found [No such file or directory]
(Many more similar errors after this)
Post by Dan Douglas
"FUNCNAME" might be good to have because it's related to "BASH_SOURCE" in a
similar manner as ".sh.fun" and ".sh.file".
I tried implementing FUNCNAME using the debugger. The trouble is expanding
new elements on the end during expansion, but then it can't shrink.
function FUNCNAME.get {
nameref self=${.sh.name}
if (( .sh.subscript < .sh.level )); then
trap "(( .sh.level -= .sh.subscript + 1 )); eval '(( .sh.level =
${.sh.level} ))' \; _=\${.sh.fun}" DEBUG
trap - DEBUG;
fi
(( .sh.subscript < .sh.level - 2 )) && self[.sh.subscript + 1]=
}
Still lots of goodies in RELEASE I've yet to play with.
--
Dan Douglas
_______________________________________________
ast-developers mailing list
ast-developers at lists.research.att.com
http://lists.research.att.com/mailman/listinfo/ast-developers
--
Regards
Danny
_______________________________________________
ast-developers mailing list
ast-developers at lists.research.att.com
http://lists.research.att.com/mailman/listinfo/ast-developers
--
Regards

Danny
Danny Weldon
2014-07-10 03:07:28 UTC
Permalink
I had these errors when I tried out completion on Ubuntu 12.04.4 LTS.

It typed "git he" and pressed tab to see if it would complete the word "help":


$ ./bash -l
bash: warning: shell level (5404176) too high, resetting to 1
danny at danny-ubuntu ~/wrk/ksh/ast-ksh.2014-06-25/arch/linux.i386-64/bin
$ git he<tab>

This is what happens next (btw, it backspaced over the 'e'):

$ git hbash: _upvars: cword: invalid option
./bash: _git[22803]: compgen[3]: add: not found [No such file or directory]
./bash: _git[22803]: compgen[4]: get-tar-commit-id: not found [No such
file or directory]
./bash: _git[22803]: compgen[5]: reflog: not found [No such file or directory]
./bash: _git[22803]: grep: no pattern
./bash: _git[22803]: compgen[7]: relink: not found [No such file or directory]
./bash: _git[22803]: compgen[8]: am: not found [No such file or directory]
./bash: _git[22803]: compgen[9]: gui: not found [No such file or directory]
./bash: _git[22803]: compgen[10]: remote: not found [No such file or directory]
./bash: _git[22803]: compgen[11]: annotate: not found [No such file or
directory]
./bash: _git[22803]: compgen[12]: apply: not found [No such file or directory]

(Many more similar errors after this)
Post by Dan Douglas
"FUNCNAME" might be good to have because it's related to "BASH_SOURCE" in a
similar manner as ".sh.fun" and ".sh.file".
I tried implementing FUNCNAME using the debugger. The trouble is expanding
new elements on the end during expansion, but then it can't shrink.
function FUNCNAME.get {
nameref self=${.sh.name}
if (( .sh.subscript < .sh.level )); then
trap "(( .sh.level -= .sh.subscript + 1 )); eval '(( .sh.level = ${.sh.level} ))' \; _=\${.sh.fun}" DEBUG
trap - DEBUG;
fi
(( .sh.subscript < .sh.level - 2 )) && self[.sh.subscript + 1]=
}
Still lots of goodies in RELEASE I've yet to play with.
--
Dan Douglas
_______________________________________________
ast-developers mailing list
ast-developers at lists.research.att.com
http://lists.research.att.com/mailman/listinfo/ast-developers
--
Regards

Danny
Dan Douglas
2014-07-04 23:33:23 UTC
Permalink
"FUNCNAME" might be good to have because it's related to "BASH_SOURCE" in a
similar manner as ".sh.fun" and ".sh.file".

I tried implementing FUNCNAME using the debugger. The trouble is expanding
"${FUNCNAME[@]}". The hack on the last line makes it sort-of work by pushing
new elements on the end during expansion, but then it can't shrink.

function FUNCNAME.get {
nameref self=${.sh.name}
if (( .sh.subscript < .sh.level )); then
trap "(( .sh.level -= .sh.subscript + 1 )); eval '(( .sh.level = ${.sh.level} ))' \; _=\${.sh.fun}" DEBUG
trap - DEBUG;
fi

(( .sh.subscript < .sh.level - 2 )) && self[.sh.subscript + 1]=
}

Still lots of goodies in RELEASE I've yet to play with.
--
Dan Douglas
Danny Weldon
2014-07-14 05:54:01 UTC
Permalink
I just noticed that "print -j" leaves a trailing comma which is currently
non-conforming json syntax. This will hopefully change: http://json5.org/

$ echo ${.sh.version}; compound xx=(this=that integer x=5); print -j xx
Version ABIJM 93v- 2014-06-25
{
"this": "that",
"x": 5, <---- Trailing comma
}
Post by David Korn
We have posted the latest ast beta source packages. I have been working on
trying to provide a bash compatibility mode and have added a number of new
features to ksh93 itself. When the ksh is liked and run as bash, several
bash features are enabled and
bash rc files are processed.
One of the major new additions, is programmable tab completion with the
editor which is enabled in both bash mode and ksh mode. Since this is
complex and has little automatic testing, I would appreciated any feedback.
I am sure that I missed a few things.
There are many other additions. Read the RELEASE file in src/cmd/ksh93 for
more
information.
We would like to get an official release in 3Q14.
_______________________________________________
ast-developers mailing list
ast-developers at lists.research.att.com
http://lists.research.att.com/mailman/listinfo/ast-developers
--
Regards

Danny
Clark Wang
2014-07-13 14:35:47 UTC
Permalink
Post by David Korn
We have posted the latest ast beta source packages. I have been working
on trying to provide a bash compatibility mode and have added a number of
new features to ksh93 itself. When the ksh is liked and run as bash,
several bash features are enabled and
bash rc files are processed.
Tried with my ~4k lines of bashrc (on Solaris 11.0 sparc). Found following
problems when running as bash:

- does not support `>&'
- does not support `type -P'
- does not `export -n'
- has no `bind' command
- does not support some `shopt' options
- PS1 magics does not work well. E.g.: \h, \V, \[
- In the interactive shell, $? is always 0 even if the latest command fails.
- The `alias' (with not arguments) output not compatible with bash.

-clark
Post by David Korn
One of the major new additions, is programmable tab completion with the
editor which is enabled in both bash mode and ksh mode. Since this is
complex and has little automatic testing, I would appreciated any feedback.
I am sure that I missed a few things.
There are many other additions. Read the RELEASE file in src/cmd/ksh93
for more
information.
We would like to get an official release in 3Q14.
_______________________________________________
ast-developers mailing list
ast-developers at lists.research.att.com
http://lists.research.att.com/mailman/listinfo/ast-developers
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.research.att.com/pipermail/ast-developers/attachments/20140713/2d604d93/attachment.html>
Loading...