csh - setting aliases with \!* into a var does not work

27 Views Asked by At

I am creating in script in which I am taking aliases and parse it in csh. Once any aliase contains the following chars "!*" the var is not set. for example :

alias kuku 'say hello \!*'
set x=`which kuku`
which kuku
      kuku:    aliased to say hello !*
echo $x
      echo: No match.

any idea how can I store the alias into a var or alternatively having the option to remove this char "!*" without changing the alias itslef?

1

There are 1 best solutions below

0
user8253554 On

Solution:

which kuku > file
set include=`cat file | perl -pi -e "s/\!\*//g"`
echo $include 
include:    aliased to say hello