On Wed, Dec 23, 2015 at 2:49 PM, James Thomas Moon <jtm.m...@gmail.com> wrote: > In my case, I would like to preserve a copy of all passed arguments: > > set -ue > readonly -a ARGS=("${@}") > > If no arguments are passed then the script fails. It's surprising the error > behavior diverges depending upon setting an empty array or non-empty array.
I can't reproduce this. My script always returns 0. What version of Bash are you using? Or perhaps can you post your actual script? The cause of it might be somewhere. #!/bin/bash set -ue readonly -a ARGS=("$@") echo "$?"