You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
osh$ set a b c
osh$ echo"${@:0:1}"
osh a b c
osh$ echo"${@:0:2}"
osh a
$ set a b c
$ echo"${@:0:1}"
bash
$ echo"${@:0:2}"
bash a
This was found while toying around, not from a real script. I was testing if ${@::1} would return $1 or $0, as the Bash manual says "Substring indexing is zero-based unless the positional parameters are used, in which case the indexing starts at 1 by default." but ${@::1} evaluates to $0, anyway. :/
The text was updated successfully, but these errors were encountered:
This was found while toying around, not from a real script. I was testing if
${@::1}
would return$1
or$0
, as the Bash manual says "Substring indexing is zero-based unless the positional parameters are used, in which case the indexing starts at 1 by default." but${@::1}
evaluates to$0
, anyway. :/The text was updated successfully, but these errors were encountered: