Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

beethovengirl

macrumors regular
Original poster
Jan 15, 2004
150
1
While I'm waiting for suggestions on user-friendly implementations of ssh and scp for Mac OS X, I was hoping someone could help me set up aliases in Terminal. I'm accustomed to getting UNIX accts from school in which there is a .cshrc, .login, or .aliases file that makes setting up aliases obvious, but I couldn't figure it out in OS X.

By the way, I'm using tcsh.

I'm sorry if this question is answered in Pogue's Missing Manual, but I'm waiting for amazon to deliver it. :)

Thanks for your help! :)
 
I use .login - just create the file and place it in your home directory. Close Terminal and then re-open it for the changes to take effect.
 
I looked at the google results, but they were contradictory about which syntax to use [whether or not there is an equal sign, for example]. Plus, a lot of them say to edit the .tcshrc or .cshrc in my home directory, but there is no file like that, as I'm accustomed in my the UNIX accounts I've used in the past.

Can the .login file contain only the alias commands? I'm scared of creating my own .login or .cshrc file...I don't want to mess up anything. :(

Thanks for your help! :)
 
no worries. just make a .tcshrc file in your home directory (either vi it or use touch) and put your aliases in it.

mine looks like this:

alias ls ls -F
alias la ls -a
alias l ls -ls
alias ll ls -als

alias c clear
alias h history
alias j 'jobs -l'
alias m more
alias v vi

alias ab cd -
alias k 'cd ..'

alias 5 'set prompt="%# "'
alias 7 'set prompt = "[%m:%c3] `id -nu`%# "'
alias 8 'set prompt = "[%c3] > "'


my .login looks like this:

# F@H commands
alias fstart 'cd ~/F@H1; ./OSX-3.25 -local -advmethods&; cd ~/F@H2; ./OSX-3.25 -local -advmethods&'
alias fstop 'killall OSX-3.25'
alias fwork '~/.work'
alias fwork2 'date && cat ~/F@H1/unitinfo.txt ~/F@H2/unitinfo.txt'
alias frid '~/.rid'

setenv EDITOR /usr/bin/vi

setenv MYSQL_PATH /usr/local/mysql
setenv VOSGES_PATH /Users/zim/Documents/vosges/devel

setenv PATH .:/usr/local/bin:${PATH}:${HOME}/bin:${VOSGES_PATH}/bin:${MYSQL_PATH}/bin

set filec

8


i really do mean to move those folding commands out of .login, one of these days...
 
This is so annoying. I can not get it to work.

i put this:

alias gosnowball 'ssh -l snowball 64.***.***.*** in

.tcshrc in my home directory and when i go back into terminal it does nothing. I can vi the file and the line is still there in the file but it doesn't work. what the funk
 
This is so annoying. I can not get it to work.

i put this:

alias gosnowball 'ssh -l snowball 64.***.***.*** in

.tcshrc in my home directory and when i go back into terminal it does nothing. I can vi the file and the line is still there in the file but it doesn't work. what the funk

What do you get if you type

Code:
echo $SHELL

in Terminal?
 
First make sure that there is a final ' at the end of your alias line.

Then type the following in your terminal:
source .tcshrc

Then type:
alias
to get a list of all of your aliases.

Get a book on the c shell and read the first couple of chapters. I recommend Anderson and Anderson The Unix C Shell Field Guide.

I'm not sure what you think * means, but it's a pattern matching metacharacter. The way you use it in this context is highly suspect.
 
I'm not sure what you think * means, but it's a pattern matching metacharacter. The way you use it in this context is highly suspect.

I assumed 1=1? was simply using the *'s in his post to keep from revealing an IP address.

I'm wondering if he's using tcsh or the default, which has been bash for quite some time.
 
I assumed 1=1? was simply using the *'s in his post to keep from revealing an IP address.

I'm wondering if he's using tcsh or the default, which has been bash for quite some time.

You're probably right on both accounts. I hadn't noticed 1=1? wasn't the OP who stated they were using tcsh.
 
I got it to work. The problem was I needed to put it in .profile

nothing i put in any other file worked.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.