Monday, April 25, 2011

What's in your cshrc?

What's in your .cshrc that gives you total command of the C shell? Aliases welcome too!

One technique or command per answer.

From stackoverflow
  • exec /bin/ksh
    

    See: Csh Programming Consdered Harmful

    See also: What Linux shell should I use?

  • Simple really....

    exec bash
    
  • alias   m0      'set d0 = `pwd`'
    alias   m1      'set d1 = `pwd`'
    ...
    alias   g0      'cd $d0'
    alias   g1      'cd $d1'
    ...
    

    Typing m0 saves the current working directory (in d0) and g0 returns to that directory.

    quark : You know about 'pushd' and 'popd'? Similar to what you have except you don't need to have a fixed number of aliases: your stack can get arbitrarily deep.
    J. A. Faucett : Thanks, I had forgotten about these. The drawback is that it's a stack. I tend to move around several directories in random order. As far as the fixed number issue, I can't remember more than about five anyway. Also the d0... can be used in other commands, like "cp $d1/myfile $d2".
  • exec /bin/zsh

    Oh z shell, what would I do without you?

0 comments:

Post a Comment

Note: Only a member of this blog may post a comment.