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:
If I change the line with the $(......) concept to using backticks i.e. change
Quote:
to
Quote:
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:
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?
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. |
Quote:
EDIT_STRING=$(echo alex | grep "alex" ) |
Quote:
EDIT_STRING=`echo alex | grep "alex" ` |
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 |
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?