Article 5RG9R ksh93 crashes with failed assertion 'pw'

ksh93 crashes with failed assertion 'pw'

by
aikempshall
from LinuxQuestions.org on (#5RG9R)
On Current from the ksh93 command line (konsole) if I run this code

Code:echo "alex" | while read LINE
do
EDIT_STRING=$(echo alex | grep "alex" )
echo $EDIT_STRING
mktemp aik.XXXXXX
doneIt fails with

Quote:
../src/cmd/ksh93/sh/jobs.c:1110: failed assertion 'pw'

Warning: Program '/bin/ksh' crashed.
If I change the line with the $(......) concept to using backticks i.e. change

Quote:
EDIT_STRING=$(echo alex | grep "alex" )
to

Quote:
EDIT_STRING=`echo alex | grep "alex" `
so the code looks like

Code:echo "alex" | while read LINE
do
EDIT_STRING=`echo alex | grep "alex" `
echo $EDIT_STRING
mktemp aik.XXXXXX
doneThe code works as expected as in

Quote:
alex
aik.3v7k9R
The $(........) code still fails if another command is called instead of mktemp.

Code:echo "alex" | while read LINE
do
EDIT_STRING=$(echo alex | awk '/alex/{print $1}')
echo $EDIT_STRING
cat /etc/fstab
done
If the while loop is removed so the code looks like this

Code:EDIT_STRING=$(echo alex | grep "alex" )
echo $EDIT_STRING
mktemp aik.XXXXXXThe code works as expected.

In a bash shell the original code with the $(........) and while loop works as expected.

In ksh93 on Slackware 14.2 the original code with the $(........) and while loop works as expected.

I originally raised this problem in https://www.linuxquestions.org/quest...27-4175703024/

I also note on the official download site at https://github.com/att/ast/releases/tag/2020.0.0
It states that ksh2020 is not maintained or supported

A consistently working $(....................) concept is important to me. So it looks like I'll have to migrate my scripts to something other than ksh93 as I don't think ksh93 is going to be fixed anytime soon.

Any thoughts?latest?d=yIl2AUoC8zA latest?i=wjeykQ6YVJ4:iO6GN9LgKcc:F7zBnMy latest?i=wjeykQ6YVJ4:iO6GN9LgKcc:V_sGLiP latest?d=qj6IDK7rITs latest?i=wjeykQ6YVJ4:iO6GN9LgKcc:gIN9vFwwjeykQ6YVJ4
External Content
Source RSS or Atom Feed
Feed Location https://feeds.feedburner.com/linuxquestions/latest
Feed Title LinuxQuestions.org
Feed Link https://www.linuxquestions.org/questions/
Reply 0 comments