Agustin Martin dixit:
>${*#triggered} was actually a reminescence of an attempt to trim "triggered"
>string from "$*" string
Yes, the problem being that $* is not a string but a vector (which
expands to something similar though, but cannot directly be trimmed).
(You could do x="$*"; ${x#...} but this isn’t needed here.)
This is common to at least mksh and pdksh.
>In this particular case, I'd expect that both
>
> for trigger in "$@"; do
>
>and
>
> for trigger in $*; do
>
>should in practice work.
The differences are: given a script x invoked with 'foo bar' 'baz':
$* → 'foo' 'bar' 'baz'
$@ → 'foo' 'bar' 'baz'
"$*" → 'foo bar baz'
"$@" → 'foo bar' 'baz'
Other than word splitting, there’s no difference between "$*" and
"$@" (in double quotes), and without the double quotes they don’t
differ at all. (But in practice, using "$@" when dealing with “user”
input is good style.)
Thanks for considering!
bye,
//mirabilos
--
FWIW, I'm quite impressed with mksh interactively. I thought it was much
*much* more bare bones. But it turns out it beats the living hell out of
ksh93 in that respect. I'd even consider it for my daily use if I hadn't
wasted half my life on my zsh setup. :-) -- Frank Terbeck in #!/bin/mksh
--
To UNSUBSCRIBE, email to [email protected]
with a subject of "unsubscribe". Trouble? Contact [email protected]