[t]csh => Pass var containing multiline string to an alias
Domagoj Smolčić
rank1seeker at gmail.com
Thu Feb 6 16:56:59 UTC 2020
Yo Crew ..., so ...
I want to pass variable containing multiline string to an alias, so it would also be multiline string.
Var first:
--
set t_var='a\
b'
--
Expands to:
--
a
b
--
So far so good, now alias:
Double quotes are mandatory, else all ends up at 1 line
--
alias t_name "aa $t_var bb"
--
Error:
Unmatched '"'.
Manual replacement:
--
alias t_name "aa a\
b bb"
--
Results in:
# alias t_name
aa a
b bb
Exactly what I want ...
Going back to var in order to make it, to be expanded with additional \
--
set t_var='a\\
b'
--
Expands to:
--
a\
b
--
And that is exactly a string which I've manually replaced above.
After # source /.cshrc
Unmatched '"'.
What is going on?
I've tried adding many \'s and playing wit all types of quotes in all kind of combinations just to find out I've lost 4 hours on something like THIS!
Am I completely missing something totally obvious?!?
PS: version tcsh 6.20.00 (Astron) 2016-11-24 (i386-intel-FreeBSD) options wide,nls,dl,al,kan,sm,rh,color,filec
Domagoj Smolčić
More information about the freebsd-hackers
mailing list