how to set a function to an alias in C shell [Archive] - C Board

PDA

View Full Version : how to set a function to an alias in C shell


xstone
09-27-2001, 11:03 AM
In B shell's .profile, I set up as following:

function mycd
{
if 'cd' "$@"
then
PS1="`uname -n`:`pwd` $ "
fi
}

alias cd=mycd

So evenytime when I do "cd", it shows me the current directory.

I am trying do the same thing in C shell. I add these statements in .cshrc file, but it doesn't work.

Is there anybody who can tell me how to set a function to an alias in C shell? Thanks.

xstone
09-29-2001, 04:41 PM
Can any guru take a look of it?
:(