[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
`declare -fp` mishandles heredoc with || statement
From: |
Mike Frysinger |
Subject: |
`declare -fp` mishandles heredoc with || statement |
Date: |
Fri, 31 May 2013 22:37:17 -0400 |
User-agent: |
KMail/1.13.7 (Linux/3.8.3; KDE/4.6.5; x86_64; ; ) |
simple code snippet:
$ cat test.sh
func() {
cat > / <<EOF || echo FAIL
11
EOF
}
declare -fp
when run, we see the || statement is incorrectly moved to after the heredoc:
$ bash ./test.sh
func ()
{
cat > / <<EOF
11
EOF
|| echo FAIL
}
every version of bash i tried fails this way (2.05b through 4.2.45)
-mike
signature.asc
Description: This is a digitally signed message part.
- `declare -fp` mishandles heredoc with || statement,
Mike Frysinger <=