Is a fish shell variable just a string separated with spaces?
22:01 10 Apr 2026

The docs say that all variables are lists, and I thought that meant they had some special internal structure that was outside the scope of the shell interface. Like, how the , in the python list [1,2,3] is just part of the representation of the list, not part of the actual list, and you can't change the delimiter to something else. But I did some tests:

$ set -l a aa ab ac ad  
$ echo $a[2]  
ab  
$ set a (echo $a | sed 's/a/z/g')  
$ echo $a  
zz zb zc zd
$ set a (echo $a | set 's/ /,/g')
$ echo $a
zz,zb,zc,zd

So, I can just modify the entire variable like it is just a normal string.

It seems to me that a variable is just a string, and the spaces are interpreted as delimiters between elements.

arrays shell scripting fish