 |
 |
.alias & .tcshrc files...
|
 |
|
 |
|
Mac Enthusiast
Join Date: Mar 2001
Location: ~
Status:
Offline
|
|
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
|
|
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
|
| |
|
|
|
 |
|
 |
|
Mac Enthusiast
Join Date: Mar 2001
Location: ~
Status:
Offline
|
|
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
|
|
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
|
|
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
|
| |
|
|
|
 |
|
 |
|
Mac Enthusiast
Join Date: Mar 2001
Location: ~
Status:
Offline
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
| |
|
|
|
 |
 |
|
 |
|
|
|
|
|

|
|
 |
Forum Rules
|
 |
 |
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
|
HTML code is Off
|
|
|
|
|
|
 |
 |
 |
 |
|
 |
|