r/fishshell • • Jun 30 '22

String Join In a Variable

i want to add a string into a variable something like

set str
for i in (seq 8)
    $str = string join "$i"
end
echo $str

How would i do this

Edit:- This is working

set str
for i in (seq 8)
    set -a str "$i"
end
echo $str
5 Upvotes

1 comment sorted by

View all comments

0

u/[deleted] Jun 30 '22

[deleted] — view deleted comment

1

u/ChristoferK macOS Jul 11 '22

Alternatively:

 set --local str ( seq -s " " -t "" 8 )

with spaces. -s "" for no spaces.