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 > .alias & .tcshrc files...

.alias & .tcshrc files...
Thread Tools
Mac Enthusiast
Join Date: Mar 2001
Location: ~
Status: Offline
Reply With Quote
Jul 4, 2004, 05:59 PM
 
Some will be rolling eyes at this but I can't seem to make alias' work...

I've entered these test alias's into my .tcshrc file:

alias te '/Applications/TextEdit.app'
alias . 'pwd'
alias .. 'cd ..'
alias cd.. 'cd ..'

but the message I keep getting in the terminal when I source the .tcshrc (source .tcshrc) is:

-bash: alias: te: not found
-bash: alias: /Applications/TextEdit.app: not found
-bash: alias: .: not found
-bash: alias: pwd: not found
-bash: alias: ..: not found
-bash: alias: cd ..: not found
-bash: alias: cd..: not found
-bash: alias: cd ..: not found

I've also tried creating a .alias file with the same alias' and soucing it in the .tcshrc file:

source .alias

but always the same message...

I'm obvoiusly quite unexperienced with unix but I use linux at work and have quite an extensive .alias file there. I think I'm doing this correctly and am confused at the failure. Any help on how I'm failing and what to do to make it work is very much appreciated. Thanks and best regards,
Kent M

kent m is not a member of any public groups
     
Occasionally Useful
Join Date: Jun 2001
Location: Liverpool, UK
Status: Offline
Reply With Quote
Jul 4, 2004, 07:03 PM
 
Originally posted by kent m:
-bash: alias: te: not found
-bash: alias: /Applications/TextEdit.app: not found
-bash: alias: .: not found
-bash: alias: pwd: not found
-bash: alias: ..: not found
-bash: alias: cd ..: not found
-bash: alias: cd..: not found
-bash: alias: cd ..: not found
i think you'll find that's a bash error message. not a tcsh message.
"Have sharp knives. Be creative. Cook to music" ~ maxelson
     
kent m  (op)
Mac Enthusiast
Join Date: Mar 2001
Location: ~
Status: Offline
Reply With Quote
Jul 4, 2004, 07:25 PM
 
thanks for the reply.

I think I'm a little fresh at this. "bash error message. not a tcsh message" means nothing to me.

My understanding is that i put the alias' into the .tcshrc file or create an .alias file that is sourced by the .tcshrc file in the syntax that I have an things ought o be dandy, and yet I keep getting errors. I need to know why I 'm getting errors...

thanks,
K

kent m is not a member of any public groups
     
Clinically Insane
Join Date: Oct 2001
Location: San Diego, CA, USA
Status: Offline
Reply With Quote
Jul 4, 2004, 07:59 PM
 
I'm not sure why bash is reading your .tcshrc file — I didn't think it did — but the bash alias syntax looks like
alias foo="echo bar"
Using just an alias name causes bash to print the command that the alias is a shorthand for, and you can specify several alias names. So if you write alias foo "echo bar" it will try to print the value of the aliases "foo" and "echo bar", neither of which is actually an alias. That's why you're getting the error messages you see.
Chuck
___
"Instead of either 'multi-talented' or 'multitalented' use 'bisexual'."
     
Senior User
Join Date: Feb 2003
Location: Atlanta
Status: Offline
Reply With Quote
Jul 5, 2004, 02:25 AM
 
Originally posted by Chuckit:
I'm not sure why bash is reading your .tcshrc file — I didn't think it did
It doesn't. That is the problem here.

Kent, you are using the bash shell but entering config options in .tcshrc which is used by the tcsh shell. You have two choices to fix this.

1. switch your shell to tcsh. you can do this by typing chsh in Terminal and changing the Shell line entry to /bin/tcsh. Tcsh will then work with commands you specifiy in the .tcshrc file.

2. You can configure bash aliases for use with the bash shell. You would put these in either the .bashrc file or the .bash_profile file. If you choose this option make sure you format the aliases using the bash syntax which Chuckit posted.
2.16 Ghz Core 2 Macbook, 3GB Ram, 120 GB
     
kent m  (op)
Mac Enthusiast
Join Date: Mar 2001
Location: ~
Status: Offline
Reply With Quote
Jul 5, 2004, 07:33 PM
 
switch your shell to tcsh.
This was it. Is "bash" the new default for the Terminal in 10.3?... A bit of a surprise.

I switched the Terminal using the Prefs, setting the "Execute this command" to /bin/tcsh

Thanks,
K

kent m is not a member of any public groups
     
Senior User
Join Date: May 2001
Status: Offline
Reply With Quote
Jul 5, 2004, 07:56 PM
 
Originally posted by kent m:
alias te '/Applications/TextEdit.app'
You're going to want to use either:

alias te="/Applications/TextEdit.app/Contents/MacOS/TextEdit"

or

alias te="open /Applications/TextEdit.app/"
     
Senior User
Join Date: Feb 2003
Location: Atlanta
Status: Offline
Reply With Quote
Jul 6, 2004, 03:03 AM
 
Originally posted by kent m:
Is "bash" the new default for the Terminal in 10.3?
Yep. That's it.
2.16 Ghz Core 2 Macbook, 3GB Ram, 120 GB
     
Senior User
Join Date: Feb 2003
Location: Atlanta
Status: Offline
Reply With Quote
Jul 6, 2004, 03:04 AM
 
Originally posted by Moose:
You're going to want to use either:

alias te="/Applications/TextEdit.app/Contents/MacOS/TextEdit"

or

alias te="open /Applications/TextEdit.app/"
That's bash syntax, not tcsh, which is what he is using now.
2.16 Ghz Core 2 Macbook, 3GB Ram, 120 GB
     
Senior User
Join Date: May 2001
Status: Offline
Reply With Quote
Jul 6, 2004, 07:36 AM
 
Originally posted by coolmacdude:
That's bash syntax, not tcsh, which is what he is using now.
Well. Sodomize me gently with a pitchfork.

He's still going to want to use either "open" or launch the binary itself. Trying to execute the directory's going to get him nowhere.
     
Senior User
Join Date: Feb 2003
Location: Atlanta
Status: Offline
Reply With Quote
Jul 6, 2004, 01:04 PM
 
Originally posted by Moose:
Well. Sodomize me gently with a pitchfork.
LOL.

Originally posted by Moose:
He's still going to want to use either "open" or launch the binary itself. Trying to execute the directory's going to get him nowhere.
Yes you are right. I hadn't even bothered to look at what the alias was he was making to notice that.

Use alias te 'open /Applications/TextEdit.app'
2.16 Ghz Core 2 Macbook, 3GB Ram, 120 GB
     
   
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 12:05 AM.
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