Thread: how to set a function to an alias in C shell

  1. #1
    Registered User
    Join Date
    Sep 2001
    Posts
    8

    how to set a function to an alias in C shell

    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.

  2. #2
    Registered User
    Join Date
    Sep 2001
    Posts
    8
    Can any guru take a look of it?

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. In over my head
    By Shelnutt2 in forum C Programming
    Replies: 1
    Last Post: 07-08-2008, 06:54 PM
  2. We Got _DEBUG Errors
    By Tonto in forum Windows Programming
    Replies: 5
    Last Post: 12-22-2006, 05:45 PM
  3. Please Help - Problem with Compilers
    By toonlover in forum C++ Programming
    Replies: 5
    Last Post: 07-23-2005, 10:03 AM
  4. c++ linking problem for x11
    By kron in forum Linux Programming
    Replies: 1
    Last Post: 11-19-2004, 10:18 AM
  5. Serial Communications in C
    By ExDigit in forum Windows Programming
    Replies: 7
    Last Post: 01-09-2002, 10:52 AM