Results 1 to 10 of 20

Thread: BASH question

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. Default BASH question

    ok all you linux and unix experts!

    i got a bit of a question for you.

    in class, we're using alot of Unix stuff. we're using SSH Secure Shell client to connect to the school's unix machines (dunx1 and tux). I've changed my shell over from c-shell to BASH. after getting bored of the default BASH prompt, i changed it.

    in order to do so, (and keep the change for each session) i created a file in myhome directory called .bash_profile and placed the following line in it:

    PS1="(\#)[\h:\W]touch me$ "

    what that does is it makes my prompt tell me the # of commands i've executed so far, the name of the machine i'm on, and the directory i'm in. it works beautifully.

    here's where my problem appears. whenever i cd to a new directory, i always type "ls -lah" to list what's in it. to save time and because i was bored, i decided to make that into a shell function. now, my .bash_profile reads:


    PS1="(\#)[\h:\W]touch me$ "
    function cdsee(){ cd $1; ls -lah;}

    however, my prompt is now being displayed AFTER everything i do. and the cursor is in front of it, so i end up typeing over my prompt. example:

    (2)[dunx1:aea56]touch me$ _ <--normal, i'd start typing at the _

    (7)[dunx1:aea56]touch me$ <---now, again, i type at the _ but this time it's on top of the prompt


    there is no reason i can see that would cause this, so i'm hoping that one of you might have some sort of hidden technique up your sleeves that can help. thanks guys!
    Last edited by acolyte_to_jippity; 10-19-2010 at 12:11 PM.
    Quote Originally Posted by OMGBEARS
    I feel it is important for me to let you know how feeble your efforts to strike such feelings inside of me really are. I have the internal fortitude of a large animal, an elephant, for instance. Likewise, I'm the result of coitus between the devil and a pack mule made out of chainsaws, so I am extremely strong, and carry little care for others in this world. Trees also stand aside due to my chainsaw blood.
    Quote Originally Posted by ๖ReS View Post
    How am I supposed to tell you to fuck off without replying ?

Posting Permissions

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