TCSH... why?

Posted:
in Mac Software edited January 2014
Why does Apple use TCSH when it's such a pain in the ass to use RegEx with grep and egrep as compared to BASH?
«1

Comments

  • Reply 1 of 36
    eugeneeugene Posts: 8,254member
    Quote:

    Originally posted by pyr3

    Why does Apple use TCSH when it's such a pain in the ass to use RegEx with grep and egrep as compared to BASH?



    c-shells have been the default user shell for BSDs as long as I can remember. It's tradition, and in some ways it's easier for novice UNIX users. Apple probably figures advanced users who want bash will change their shell to it on their own.



    bash (mimicking sh) is the default root shell though.
  • Reply 2 of 36
    thuh freakthuh freak Posts: 2,664member
    in case you dont know just how to change your default shell, open up netinfo, unlock it (with your password), and navigate to /users/<username> (when i say navigate, i mean inside netinfo, not in the finder or something else). there is a 'shell' property associated with each user in /users. simply change yours to '/bin/bash' (or /path/to/prefered/shell, like /bin/csh, /bin/zsh, or possibly something fink'd like /sw/bin/bash). save netinfo (quit if your done with it), and open a new terminal window. now you're in your new shell.
  • Reply 3 of 36
    Quote:

    Originally posted by thuh Freak

    in case you dont know just how to change your default shell, open up netinfo, unlock it (with your password), and navigate to /users/<username> (when i say navigate, i mean inside netinfo, not in the finder or something else). there is a 'shell' property associated with each user in /users. simply change yours to '/bin/bash' (or /path/to/prefered/shell, like /bin/csh, /bin/zsh, or possibly something fink'd like /sw/bin/bash). save netinfo (quit if your done with it), and open a new terminal window. now you're in your new shell.



    good call. then post what your favorite shells, each has a strengths. that debate predates mac/win...





    fuel for the fire. I loved tcsh (or was it just csh?) best for C programming back in the day!
  • Reply 4 of 36
    1337_5l4xx0r1337_5l4xx0r Posts: 1,558member
    OK, this is slightly off-topic, but hey, this is an AppleInsider thread .

    So I switched shells from the annoying tcsh to the old, familiar bash. But in either, my .*rc file has aliases which do not behave as they should. eg:

    ls='ls --colour'

    ll='ls -l'

    nano='pico'



    etc do not work. i get errors like:

    ll

    error: -l not found (ie: ls -l is trying to list a file called "-l").



    Does anyone have aliases working properly? Was voodoo required to do so? My exact same aliases for the exact same shells work spiffy in linux; I'm curious why they don't here.



    Anyone?
  • Reply 5 of 36
    chuckerchucker Posts: 5,089member
    My aliases work fine. I'm using tcsh, though. Some of the aliases I use:



    alias ls "ls --color=auto"

    alias ll "ls -l"

    alias pico "nano"

    alias damn "sudo killall -9 lookupd"
  • Reply 6 of 36
    chuckerchucker Posts: 5,089member
    Just tried putting



    alias ll="ls -l"



    in .bashrc, and it works.
  • Reply 7 of 36
    chuckerchucker Posts: 5,089member
    Quote:

    Originally posted by pyr3

    Why does Apple use TCSH when it's such a pain in the ass to use RegEx with grep and egrep as compared to BASH?



    Maybe because every shell has its advantages and disadvantages? You're free to change your shell to bash.
  • Reply 8 of 36
    eugeneeugene Posts: 8,254member
    Quote:

    alias damn "sudo killall -9 lookupd"







    It's amazing after all this time lookupd still gets wedged this often.
  • Reply 9 of 36
    chuckerchucker Posts: 5,089member
    Quote:

    Originally posted by Eugene





    It's amazing after all this time lookupd still gets wedged this often.




    NeXT users were right with calling it "lockup daemon".
  • Reply 10 of 36
    thuh freakthuh freak Posts: 2,664member
    Quote:

    Originally posted by I-bent-my-wookie

    good call. then post what your favorite shells, each has a strengths. that debate predates mac/win...





    fuel for the fire. I loved tcsh (or was it just csh?) best for C programming back in the day!




    my current one is bash. mainly because tcsh has problems redirecting stderr (2). i prefer tcsh's tabbing to bash's, but i have to live through it in order to survive my cold stderr hell. i also seem to remember that tcsh kept the prompt shorter (when showing the cwd) even when the cwd was huge. i hear that zsh is a dreamthough, haven't really taken the time to convert my .profile, so i didn't get a really good test drive. i think i'm going to make my own shell soon, or maybe a full terminal-type program, which will keep stdout, stderr and stdin in separate sections of the window. i think that'd be kinda cool (in a g33k3 manner).
  • Reply 11 of 36
    1337_5l4xx0r1337_5l4xx0r Posts: 1,558member
    Moreover, ls --color=auto doesn't display anything in color, just white on black. This is with xterm-color selected in Preferences and ANSI color NOT disabled.



    Could someone copy their .bash_profile into here? I don't have one, freestyled one and maybe that is part of the problem.



    Aliases still fuxXored. Grrrr...
  • Reply 12 of 36
    andersanders Posts: 6,523member
    I understand roughly 35% of the words used in this thread. And the only reason for it being above 20% is this post.
  • Reply 13 of 36
    kecksykecksy Posts: 1,002member
    Nerd alert!
  • Reply 14 of 36
    Quote:

    Originally posted by 1337_5L4Xx0R

    Moreover, ls --color=auto doesn't display anything in color, just white on black. This is with xterm-color selected in Preferences and ANSI color NOT disabled.



    Could someone copy their .bash_profile into here? I don't have one, freestyled one and maybe that is part of the problem.



    Aliases still fuxXored. Grrrr...




    You'll need to download and compile the standard GNU "ls" if you want color. The version that comes with OS X doesn't include that option. I'd imagine that fink would be useful for this, although I don't use it myself.



    John
  • Reply 15 of 36
    1337_5l4xx0r1337_5l4xx0r Posts: 1,558member
    I see posting but I don't see .bash_profiles...



    c'mon, people! Help a guy out here!!





    John Whitney: Ah, so!



    Thanks, hombré.
  • Reply 16 of 36
    neilwneilw Posts: 77member
    I cut my teeth on ATT flavored Unix, so am much more accustomed to ksh, and have never gotten comfortable with csh and its variants. Recently I just switched over to zsh (didn't even know it existed until I went poking around in /bin) and it is indeed very nice. Lots of features, haven't even scratched the surface yet, though I'm not generally a real shell power-user anyway.



    My extraordinarily uninteresting .zshrc file:



    Code:


    bindkey -v



    setopt NO_BEEP AUTO_CD



    export PATH=.:~/bin:$PATH

    export CDPATH=.:..:$HOME



    prefs=~/Library/Preferences

    : ~prefs



    PS1="%(2L.+.)zsh[%~] "



    alias l="ls -FC"

    alias more=less

    alias edit=vi







    Zsh actually does have fairly nice capabilities for shortening the PWD in the prompt. Not as nice as it could be, though; I used to have a little C prog that I called every time I did a "cd", and it spit out a more "intelligently" shortened PWD. May still go back to that, but for now what zsh is doing is good enough.



    Heck, I'm just happy to be free of tcsh finally...
  • Reply 17 of 36
    chuckerchucker Posts: 5,089member
    Quote:

    Originally posted by John Whitney

    You'll need to download and compile the standard GNU "ls" if you want color. The version that comes with OS X doesn't include that option. I'd imagine that fink would be useful for this, although I don't use it myself.



    John




    fink's "fileutils" package includes GNU ls.
  • Reply 18 of 36
    elricelric Posts: 230member
    Here is my .profile for bash not much to it, editor pref, pager pref, a lil short prompt and a couple of aliases



    EDITOR=pico; export EDITOR

    PAGER=less; export PAGER

    PS1='\\w\\$ '; export PS1



    alias ls="ls -F"

    alias ll="ls -al"
  • Reply 19 of 36
    thuh freakthuh freak Posts: 2,664member
    here's my `.bash_profile'. it's mostly just a conversion of my .tcshrc, with some extras thrown in here and there as they came up. link (its a link, cuz my LS_COLORS fuk with the formatting on this page).
  • Reply 20 of 36
    1337_5l4xx0r1337_5l4xx0r Posts: 1,558member
    Thanks, all of you. I'll have to get me the new color (colour) ls and tweak a bash profile.
Sign In or Register to comment.