Skip to content

Equivalent to array[@] bash array substring expansion #9779

Closed Answered by faho
dpetka2001 asked this question in Q&A
Discussion options

You must be logged in to vote

$list by default expands to all elements of the list. If you want specific elements of the list, you can use $list[1] for the first, or $list[1..3] for the first, second and third, or $list[-1] for the last.

Read https://fishshell.com/docs/current/fish_for_bash_users.html#variables and https://fishshell.com/docs/current/language.html#lists for more.

Replies: 2 comments 2 replies

Comment options

You must be logged in to vote
1 reply
@dpetka2001
Comment options

Answer selected by dpetka2001
Comment options

You must be logged in to vote
1 reply
@dpetka2001
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants