May you please explain what does this mean:
@:1:$#-1
can you provide an exact explanation?
May you please explain what does this mean:
@:1:$#-1
can you provide an exact explanation?
That's a parameter expansion that returns all the positional parameters but the last one.
It's based on ${parameter:offset:length}
, where using @
as parameter makes it work on positional parameters. The length $#-1
is the number of positional parameters ($#
) minus one.
Here's a showcase : https://ideone.com/HKcaNj