up.sh, down.sh, get_rune.sh, show_cln_uris.sh, lightning-cli.sh and get_node_uri.sh all shift inside for i in "$@".
The problem
for i in "$@"; do
case $i in
--id=*)
NODE_ID="${i#*=}"
shift
;;
--port=*)
PORT="${i#*=}"
shift
;;
*)
;;
esac
done
for i in "$@" expands the positional parameters once, so shift never advances the iteration -- it only mutates $@ underneath the loop. lightning-cli.sh and get_node_uri.sh additionally pair this with an empty *) branch, so unknown arguments are accepted silently; the other four echo and exit.
Why it matters
The shape cannot parse an option whose value is a separate word, and lightning-cli.sh forwards the post-shift $@ to lightning-cli, so the mutation reaches the wrapped command. Whether any current invocation order actually misfires is unmeasured.
up.sh,down.sh,get_rune.sh,show_cln_uris.sh,lightning-cli.shandget_node_uri.shallshiftinsidefor i in "$@".The problem
for i in "$@"expands the positional parameters once, soshiftnever advances the iteration -- it only mutates$@underneath the loop.lightning-cli.shandget_node_uri.shadditionally pair this with an empty*)branch, so unknown arguments are accepted silently; the other four echo and exit.Why it matters
The shape cannot parse an option whose value is a separate word, and
lightning-cli.shforwards the post-shift$@tolightning-cli, so the mutation reaches the wrapped command. Whether any current invocation order actually misfires is unmeasured.