Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Mac OS X > Aliases

Aliases
Thread Tools
Junior Member
Join Date: Sep 2002
Location: The Alamo City
Status: Offline
Reply With Quote
Jan 17, 2003, 11:59 PM
 
I frequently ssh to the system at school and would really like to cut down on my kestrokes (i.e. be lazy). So instead of ssh -l username servername, I would like to create an alias. However, where do I create it.

I know it were a cShell (csh), I could edit .cshrc and create the alias there, but where would I do it on my Mac?

Thanx!
     
Addicted to MacNN
Join Date: May 2001
Location: Cupertino, CA
Status: Offline
Reply With Quote
Jan 18, 2003, 01:45 AM
 
Edit .cshrc and create the alias there... unless you've switched to a different shell for some reason.
     
Dedicated MacNNer
Join Date: Nov 2000
Status: Offline
Reply With Quote
Jan 18, 2003, 09:47 AM
 
For tcsh:
echo "alias foo 'echo foo'" >> ~/.cshrc

for bash:
echo "alias foo='echo foo'" >> ~/.bashrc
     
Junior Member
Join Date: Sep 2002
Location: The Alamo City
Status: Offline
Reply With Quote
Jan 18, 2003, 04:28 PM
 
>>Edit .cshrc and create the alias there... unless you've switched to a different shell for some reason.

Isn't the default Terminal tcsh? How would I go about changing it to csh, if it's even possible?

>>For tcsh:
echo "alias foo 'echo foo'" >> ~/.cshrc

What does this do?

I know I could change the sell via chsh, but how do I know if I have csh.

Thanks for everyone's help!
     
Addicted to MacNN
Join Date: May 2001
Location: Cupertino, CA
Status: Offline
Reply With Quote
Jan 18, 2003, 05:06 PM
 
tcsh reads the .cshrc file when it starts up just like csh does, so you can put whatever variables or aliases you want to set in there. Just remember to quit and restart Terminal for it to take effect.
     
Junior Member
Join Date: Sep 2002
Location: The Alamo City
Status: Offline
Reply With Quote
Jan 18, 2003, 11:11 PM
 
Ok, next questions: where is the .cshrc file?

I tried locate, but it returned nothing.
     
Addicted to MacNN
Join Date: May 2001
Location: Cupertino, CA
Status: Offline
Reply With Quote
Jan 19, 2003, 05:00 AM
 
It's at the top level of your home directory, at ~/.cshrc

I guess you may have to create one if it isn't already there.
     
   
Thread Tools
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Top
Privacy Policy
All times are GMT -5. The time now is 07:28 PM.
All contents of these forums © 1995-2011 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.7 © 2000-2011, Jelsoft Enterprises Ltd., Content Relevant URLs by vBSEO 3.3.2