Re: Bad substitution breaks conditional statement

2020-10-14 Thread Chet Ramey
On 10/13/20 11:43 PM, Martin Schulte wrote: > Consider the following script: > > #!/bin/bash > > echo "${x;:-}" ; echo "Not executed" > echo "Executed" > > echo "${x:-}" ;; echo "Not executed" > echo "Not executed" > <<< > > It just a source of problems that the two syntactical errors (bo

Re: Bad substitution breaks conditional statement

2020-10-14 Thread Chet Ramey
On 10/13/20 4:42 PM, Martin Schulte wrote: > Hi Chet, hi all! > >> In general, variable expansion errors cause posix-mode shells to exit and >> bash default mode shells to abort execution of the current command and >> return to the top level, whether that is the command line or the next >> command

Re: Bad substitution breaks conditional statement

2020-10-14 Thread Andreas Schwab
On Okt 14 2020, Martin Schulte wrote: > Consider the following script: > > #!/bin/bash > > echo "${x;:-}" ; echo "Not executed" > echo "Executed" > > echo "${x:-}" ;; echo "Not executed" > echo "Not executed" > <<< > > It just a source of problems that the two syntactical errors (both caused