LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 11-03-2021, 11:26 AM   #1
aikempshall
Member
 
Registered: Nov 2003
Location: Bristol, Britain
Distribution: Slackware
Posts: 853

Rep: Reputation: 122Reputation: 122
../src/cmd/ksh93/sh/jobs.c:1110: failed assertion 'pw'


When I run the following from the command line within bash

Code:
echo "alex" | while read LINE
do
EDIT_STRING=$(echo alex | grep "${LINE}" )
if [[ ! -z "$EDIT_STRING" ]];then 
        echo $EDIT_STRING
        mktemp aik.XXXXXX
fi 
done
I get the expected results which is

Quote:
alex
aik.HCxyWH
However, when I run it in a ksh It fails with

Quote:
alex
../src/cmd/ksh93/sh/jobs.c:1110: failed assertion 'pw'
Abort
aik.RiMRAo
This version of ksh is - Version A 2020.0.0

When I run it in a much earlier version of ksh - Version AJM 93u+ 2012-08-01 it works!

I can't spot what's wrong. Can anyone point me in the right direction to understand what I'm doing wrong.

I

Last edited by aikempshall; 11-05-2021 at 10:42 AM. Reason: Missed out do/while in first code example
 
Old 11-03-2021, 11:33 AM   #2
pan64
LQ Guru
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 17,204

Rep: Reputation: 5824Reputation: 5824Reputation: 5824Reputation: 5824Reputation: 5824Reputation: 5824Reputation: 5824Reputation: 5824Reputation: 5824Reputation: 5824Reputation: 5824
would be nice to know exactly which OS is it. You may try to use strace (or similar) to see what's happened.
It can be an incompatibility issue or a bug in that ksh.
 
Old 11-03-2021, 11:46 AM   #3
aikempshall
Member
 
Registered: Nov 2003
Location: Bristol, Britain
Distribution: Slackware
Posts: 853

Original Poster
Rep: Reputation: 122Reputation: 122
The problem occurs in Slackware 15.0.

It works in Slackware 14.2

I think I've hit on the problem if I substitute the round brackets with backticks i.e.

Code:
EDIT_STRING=$(echo alex | grep "${LINE}" )
with

Code:
EDIT_STRING=`echo alex | grep "${LINE}"`
It appears to work!

I thought that backticks had been deprecated?
 
Old 11-03-2021, 12:24 PM   #4
shruggy
Senior Member
 
Registered: Mar 2020
Posts: 3,037

Rep: Reputation: Disabled
FYI, there was an epic drama around ksh and its maintainer Kurtis Rader (krader61). Some time ago, Fedora reverted from using ksh-2020.0.0 in FC33 back to ksh-93u+20120801 in FC34, then back again to ksh-1.0.0~beta in Fedora Rawhide.
 
Old 11-03-2021, 02:07 PM   #5
aikempshall
Member
 
Registered: Nov 2003
Location: Bristol, Britain
Distribution: Slackware
Posts: 853

Original Poster
Rep: Reputation: 122Reputation: 122
Quote:
Originally Posted by shruggy View Post
FYI, there was an epic drama around ksh and its maintainer Kurtis Rader (krader61). Some time ago, Fedora reverted from using ksh-2020.0.0 in FC33 back to ksh-93u+20120801 in FC34, then back again to ksh-1.0.0~beta in Fedora Rawhide.
What a mess. So maybe no longer supported.

Strange thing copying the code into afile and running it as ksh afile works!

I feel I might have to discuss this on the slackware forum.
 
Old 11-03-2021, 02:58 PM   #6
pan64
LQ Guru
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 17,204

Rep: Reputation: 5824Reputation: 5824Reputation: 5824Reputation: 5824Reputation: 5824Reputation: 5824Reputation: 5824Reputation: 5824Reputation: 5824Reputation: 5824Reputation: 5824
you can just click on report and ask moderators to move this thread to the other forum. But I think this bug is ksh specific. And probably yes, ksh is outdated.
 
Old 11-07-2021, 10:54 AM   #7
aikempshall
Member
 
Registered: Nov 2003
Location: Bristol, Britain
Distribution: Slackware
Posts: 853

Original Poster
Rep: Reputation: 122Reputation: 122
Reverted back to Version AJM 93u+ 2012-08-01
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Issue sg_modes cmd at cmd line, want to see the cmd in binary form NuUser Linux - Newbie 1 03-28-2012 09:08 AM
Emulator woes - emulator: ../../src/xcb_io.c:249: process_responses: Assertion GunNam Linux - Mobile 1 03-30-2011 04:55 PM
openldap assertion error -- ldap_parse_result: Assertion `r != ((void *)0)' failed nottings Linux - Server 1 02-19-2009 01:20 AM
updatedb crashes: src/updatedb.c:730: scan_cwd: Assertion `name_size > 1' failed sumanc Fedora 3 07-11-2008 05:39 PM
FreeBSD 6.2, no /usr/src/tools and /usr/src/usr.bin, failed to build world. Mr_Shameless *BSD 4 05-16-2008 09:43 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 11:53 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration