New To Mac-Forums?

Welcome to our community! Join the discussion today by registering your FREE account. If you have any problems with the registration process, please contact us!

Get your questions answered by community gurus Advice and insight from world-class Apple enthusiasts Exclusive access to members-only contests, giveaways and deals

Join today!

 
Start a Discussion
 

Mac-Forums Brief

Subscribe to Mac-Forums Brief to receive special offers from Mac-Forums partners and sponsors

Join the conversation RSS
OS X - Operating System General OS operation information and support

OS 10.4 - tcsh - questions about alias, dotfiles


Post Reply New Thread Subscribe

 
Thread Tools
newdaddy

 
Member Since: Sep 28, 2007
Posts: 8
newdaddy is on a distinguished road

newdaddy is offline
Hello,

I'm a newbie, trying to port my linux dotfiles to the factory-installed BST unix under mac OS X 10.4. I have set my default shell to tcsh and I'd really like to update my .cshrc so that it works with that. I have for example this line

alias lrrt 'ls -lrt'

When I launch a new tcsh, or source this .cshrc file manually from a tcsh prompt, and then try to issue the alias with no arguments, here's what I get;

<my_iMac_tcsh_prompt> % lrrt
:No such file or directory

I've also tried this;

alias lrrt 'ls -lrt \!*'

which has the same effect.

Note that if I execute the alias directly at the tcsh prompt, and then use it with no arguments, it works

<my_prompt> % alias lrrt 'ls -lrt'
<my_prompt> % lrrt
total 72
drwxr_xr_x 183 blah blah 6222 Sep 9 13:39 some_directory
drwxr_xr_x 5 blah blah 179 Sep 13 14:44 some_other_directory
[etc.]

Also, I am attempting to set the path;

set path=($path . /Users/me/bin /usr/bin /sw/bin /sw/igpp/bin)

When this is executed as part of a .cshrc, I get

tcsh: set: Variable name must begin with a letter.

This is encouraging as it shows at least that tcsh is the shell executing the commands, but I think the syntax of the set command is correct.

If I do a

< my_prompt > % which tcsh
/bin/tcsh

is what I see.



Any suggestions or explanations about what is going on here would be truly appreciated -

C
QUOTE Thanks
newdaddy

 
Member Since: Sep 28, 2007
Posts: 8
newdaddy is on a distinguished road

newdaddy is offline
So, I now believe this has something to do with the way my .cshrc file is formatted. If I run vim and type the aliases in, one by one, then I get a clean file and it sources on startup successfully. Even cutting and pasting from the old, linux-imported file into a new vim session (with a new file) seems to work. But, looking at the hidden characters using vim (:set list) the end-of-line formatting looks to be correct.

Still a mystery, but at least I have a workaround-

C
QUOTE Thanks
mac57

 
mac57's Avatar
 
Member Since: Apr 29, 2006
Location: St. Somewhere
Posts: 4,560
mac57 has a brilliant futuremac57 has a brilliant futuremac57 has a brilliant futuremac57 has a brilliant futuremac57 has a brilliant futuremac57 has a brilliant futuremac57 has a brilliant futuremac57 has a brilliant futuremac57 has a brilliant futuremac57 has a brilliant futuremac57 has a brilliant future
Mac Specs: iMac 27" 3.4 GHz, 256 GB SSD, 2 TB HDD, 8 GB RAM

mac57 is offline
Hi, I just set up a minimal .cshrc to test this out. Here is what I put in mine:

Code:
alias c clear
alias cls 'clear;ls'
alias ls 'ls -lrt'
Then I launch tcsh via the command 'tcsh'. I get no errors. If I then type 'alias', I get this output:

Code:
[new-host:~] mac57% alias
c       clear
cls     clear;ls
ls      ls -lrt
So, it would seem that all is well... do remember that irrespective of the shell you are using, the commands (such as ls) are the BSD flavor not the Linux flavor, so the command syntax has variations. Check man as need be.

My Macs: iMac 27" 3.4 GHz, Mac Pro 3.2 GHz, PowerMac G5 Quad 2.5 GHz, G4 Cube with 1.2 GHz Upgrade
My iStuff: 64GB iPhone 5, 64GB iPad4, 30GB iPod Video, 16GB iPod Touch
My OS': Mac OS X Lion, Mac OS X Snow Leopard, Mac OS X Tiger, Mac OS 9.2.2, openSUSE 10.3
I was on the Mac-Forums honor roll for September 2007
QUOTE Thanks
mac57

 
mac57's Avatar
 
Member Since: Apr 29, 2006
Location: St. Somewhere
Posts: 4,560
mac57 has a brilliant futuremac57 has a brilliant futuremac57 has a brilliant futuremac57 has a brilliant futuremac57 has a brilliant futuremac57 has a brilliant futuremac57 has a brilliant futuremac57 has a brilliant futuremac57 has a brilliant futuremac57 has a brilliant futuremac57 has a brilliant future
Mac Specs: iMac 27" 3.4 GHz, 256 GB SSD, 2 TB HDD, 8 GB RAM

mac57 is offline
Great, glad to hear that things are moving ahead, and that mirrors my experience above.

It *sounds* like you have *something* in your original file that is throwing things off - rather like the opening directive:

Code:
#! /bin/sh
perhaps being pointed to the wrong place, hence there not being a valid command interpreter for it... I am stretching here, but that is what I would be looking for.

My Macs: iMac 27" 3.4 GHz, Mac Pro 3.2 GHz, PowerMac G5 Quad 2.5 GHz, G4 Cube with 1.2 GHz Upgrade
My iStuff: 64GB iPhone 5, 64GB iPad4, 30GB iPod Video, 16GB iPod Touch
My OS': Mac OS X Lion, Mac OS X Snow Leopard, Mac OS X Tiger, Mac OS 9.2.2, openSUSE 10.3
I was on the Mac-Forums honor roll for September 2007
QUOTE Thanks
rman

 
rman's Avatar
 
Member Since: Dec 24, 2002
Location: Los Angeles, California
Posts: 12,591
rman has much to be proud ofrman has much to be proud ofrman has much to be proud ofrman has much to be proud ofrman has much to be proud ofrman has much to be proud ofrman has much to be proud ofrman has much to be proud ofrman has much to be proud ofrman has much to be proud of
Mac Specs: 2 x 3.0GHz Quad-Core, 6GB OS X 10.6.8 | 15in MacBook Pro 2.2GHz OS X 10.6.8 | 64GB iPad 2 WiFi

rman is offline
I believe that you want to create a file called .tcshrc. In this file you will place all the items you want to define.

Life isn't about waiting for the storm to pass, It's about learning to dance in the rain!
QUOTE Thanks

Post Reply New Thread Subscribe


« Macbook freezes when password set up | Master Password+Dumb Roommate »
Thread Tools

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Posting 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 Off
Forum Jump

Similar Threads
Thread
Thread Starter
Forum
Replies
Last Post
"the alias could not be opened, because the original item cannot be found moopoo32 Internet, Networking, and Wireless 7 10-14-2011 10:49 PM
color on the terminal zero17 OS X - Development and Darwin 25 05-02-2011 03:20 PM
The alias could not be opened Merlyn Internet, Networking, and Wireless 4 05-02-2009 06:53 AM
Color your Mac Terminal? DoubleCap OS X - Development and Darwin 10 03-09-2007 11:58 PM
Questions, Questions, Questions! Excavator Switcher Hangout 2 09-02-2006 01:24 AM

All times are GMT -4. The time now is 12:20 PM.

Powered by vBulletin
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
X

Welcome to Mac-Forums.com

Create your username to jump into the discussion!

New members like you have made this community the ultimate source for your Mac since 2003!


(4 digit year)

Already a member?