Results 1 to 5 of 5
  1. #1


    Member Since
    Sep 28, 2007
    Posts
    8
    tcsh - questions about alias, dotfiles
    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

  2. #2


    Member Since
    Sep 28, 2007
    Posts
    8
    Some more info
    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

  3. #3

    mac57's Avatar
    Member Since
    Apr 29, 2006
    Location
    St. Somewhere
    Posts
    4,560
    Specs:
    iMac 27" 3.4 GHz, 256 GB SSD, 2 TB HDD, 8 GB RAM
    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

  4. #4

    mac57's Avatar
    Member Since
    Apr 29, 2006
    Location
    St. Somewhere
    Posts
    4,560
    Specs:
    iMac 27" 3.4 GHz, 256 GB SSD, 2 TB HDD, 8 GB RAM
    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

  5. #5

    rman's Avatar
    Member Since
    Dec 24, 2002
    Location
    Los Angeles, California
    Posts
    12,584
    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
    Cool
    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!

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Alias issue with Search in Finder - "The alias can't be opened ..."
    By Theophil in forum OS X - Operating System
    Replies: 0
    Last Post: 10-05-2009, 03:39 PM
  2. Time machine and .dotfiles
    By douga in forum Switcher Hangout
    Replies: 2
    Last Post: 08-30-2008, 11:06 AM
  3. Alias questions
    By jdfwarrior in forum OS X - Operating System
    Replies: 12
    Last Post: 06-26-2008, 05:27 PM
  4. linux tcsh interactive and argv
    By newdaddy in forum Running Windows (or anything else) on your Mac
    Replies: 6
    Last Post: 02-14-2008, 03:59 PM
  5. Fixing tcsh in OS X 10.2.x
    By gatorparrots in forum OS X - Development and Darwin
    Replies: 0
    Last Post: 12-23-2002, 04:29 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •