I'm trying to find a way to translate functions to
tcsh aliases, since they lack functions but have parametric aliases. As a first step I'm trying to create an
Here's what I've got so far
alias export 'setenv `echo \!:1 | cut -d'=' -f1` `echo \!:1 | cut -d'=' -f2`'
but I'm baffled as to why it's not working. I'm quite new to their syntax so I might be making a mistake that would be obvious to an experienced (
csh user. Here's the result:
% export key=value setenv: Syntax Error.
If I do almost the same thing, but use
echo instead of
setenv, it works:
alias export 'echo `echo \!:1 | cut -d'=' -f1` `echo \!:1 | cut -d'=' -f2`' % export key=value key value
That seems to confirm that everything should work, and it should get translated into
setenv key value.
What am I doing wrong?