Open edwinjhlee opened 5 months ago
I believe this is only possible from literals.
set a = 'a\
b\
c'
I've an ongoing work implementing variable assignments from pipes and redirections. Non-indexed assignments behave the same as set a = "`cat`" < myfile
. Indexed assignments (e.g: set a[1] = 'a b c'
) preserve newlines. It may be used to store binary data, but is not guaranteed to preserve all bytes (similarly to Bourne-compatible shells).
Fail using command substitution
I read the mac document, it seemed csh just turn it into a word list during command substitution. I have tried using
unset csubstnonl
. It doesn't work.My questions is, is there another way in csh that I can read the file and save the content to a variable preserving newline ?
My csh version is :
tcsh 6.24.10 (Astron) 2023-04-14 (aarch64-apple-darwin) options wide,nls,dl,al,kan,sm,rh,color,filec