Bug 1654989

Summary: zsh return 0 on parse error
Product: Red Hat Enterprise Linux 8 Reporter: Jakub Heger <jheger>
Component: zshAssignee: Kamil Dudka <kdudka>
Status: CLOSED CURRENTRELEASE QA Contact: Jakub Heger <jheger>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 8.0CC: kdudka
Target Milestone: rc   
Target Release: 8.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: zsh-5.5.1-6.el8 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2019-06-13 23:59:54 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Jakub Heger 2018-11-30 09:43:50 UTC
Description of problem:
When zsh encounters parse error in a script it return 0 (successful) code. It should return 1 or other unsuccessful code.

Version-Release number of selected component (if applicable):
zsh-5.5.1-5.el8.x86_64

How reproducible:
always

Steps to Reproduce:
1. # cat test.sh
cat >> /tmp/try <<EOF
export A="$(tr '\n' ' ' <<BLDARC
content
BLDARC)"
EOF

2. # zsh test.sh

Actual results:
test.sh:6: parse error
# echo $?
0

Expected results:
test.sh:6: parse error
# echo $?
1

Additional info:

Comment 1 Kamil Dudka 2018-11-30 12:54:26 UTC
upstream commit:

https://github.com/zsh-users/zsh/commit/ef204253

Comment 2 Kamil Dudka 2018-11-30 16:13:14 UTC
Fixed in the following Fedora builds for now:

    zsh-5.6.2-3.fc30
    zsh-5.6.2-3.fc29
    zsh-5.5.1-4.fc28