Skip to main content
edited tags
Link
Kusalananda
  • 356.1k
  • 42
  • 737
  • 1.1k
Source Link

Zsh parameter expansion

I tried to display the content of the variable fpath in column form using parameter expansion, and I couldn't do it.

After some trying and web browsing I just found another solution; which does exactly what I want. It is:

print -C1 $fpath 

But I still wonder how to do it the other way. The closest I got was:

echo ${fpath//' '/'\n'} 

But I fail to identify the white space character, so the '\n' substitution never takes place. I tried to no avail:

echo ${fpath// /'\n'} echo ${fpath//'\t'/'\n'} 

I wonder, out of curiosity, what I am doing wrong.