6 Responses

  1. Shantanu Kumar
    Shantanu Kumar at |

    Tip #1 is wrong. It does not work on redirection.

    On machines that drop me into a non-BASH shell, I usually write a .rc file and execute bash there to launch BASH. For example, when one of the machines drops me into TCSH, I write a .tcshrc file containing this:

    alias | awk -F’ ‘ ‘{ print “alias “$1″=\””$2” “$3” “$4” “$5” “$6″ \””$7″”; }’ > .bash_aliases

    and in .bashrc file, I write the following

    export PS1=[\\u@\\h:\\w]\$\
    export PS2=\>
    export PS4=+
    . .bash_aliases

    This brings me inside a BASH shell, but echo $SHELL still prints /bin/tcsh.

  2. Rohit
    Rohit at |

    Nice Tip Man !
    Thanks 🙂
    and good to see ur posts being referred by Linux today 🙂

  3. renoX
    renoX at |

    Tip#1 isn’t always correct; the SHELL environment variable isn’t alway correctly set..

    I use ‘ps -p $$’ myself.

  4. Stephan Beal
    Stephan Beal at |

    Why not just ENSURE that you’re running a specific (preferred) shell by calling:

    exec /bin/bash


    That avoids any question of “to which shell must i adapt myself for this session?”

Comments are closed.