Page 1 of 2 1 2 LastLast
Results 1 to 10 of 20

Thread: BASH question

  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 ?

  2. Default

    Quote Originally Posted by acolyte_to_jippity View Post
    in order to do so, (and keep the change for each session) i created a file in myhome directory called .bash_history and placed the following line in it:

    PS1="(\#)[\h:\W]touch me$ "
    Did you mean, you created a file named .bash_profile? .bash_history isn't where that belongs.

    Edit: Your stuff works fine for me, in ubuntu 10.10
    Kiro : us fireyes got dumb by his girl that y he is suck

  3. Default

    Quote Originally Posted by Fireye View Post
    Did you mean, you created a file named .bash_profile? .bash_history isn't where that belongs.
    :facepalm:

    yeah, that's what i meant. i had been looking at my .bash_history right before typing that post to see when it gets wiped (after each session or not)

    changed that in my post. thanks.
    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 ?

  4. Default

    Quote Originally Posted by Fireye View Post
    Edit: Your stuff works fine for me, in ubuntu 10.10
    i have no fucking clue what's going on with it. according to the accounts support people, they're not getting this thing either. and i'm not on ubuntu. it's a remote unix machine...but that shouldn't make a difference.
    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 ?

  5. Default

    Quote Originally Posted by acolyte_to_jippity View Post
    i have no fucking clue what's going on with it. according to the accounts support people, they're not getting this thing either. and i'm not on ubuntu. it's a remote unix machine...but that shouldn't make a difference.
    "remote unix machine" really isn't specific enough. What flavor of Unix, Linux, or BSD is it running? What version of bash is it running (try bash --version).

    You can use uname -a to find out what kernel it's running, and if it has lsb_release, you can try that too (lsb_release -a).
    Kiro : us fireyes got dumb by his girl that y he is suck

  6. Default

    bash --version
    Code:
    GNU bash, version 2.05b.0(1)-release (sparc-sun-solaris2.9)
    Copyright (C) 2002 Free Software Foundation, Inc.
    uname -a
    Code:
    SunOS dunx1 5.9 Generic_118558-38 sun4u sparc SUNW,Sun-Fire
    edit: i might have just fixed it. i needed a semicolon after the PS1= line in my .bash_profile
    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 ?

  7. Default

    Oh, you're running on Solaris? Good luck, have fun, I'll waaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaay over here!
    Kiro : us fireyes got dumb by his girl that y he is suck

  8. Default

    Quote Originally Posted by Fireye View Post
    Oh, you're running on Solaris? Good luck, have fun, I'll waaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaay over here!
    well, like i said. i fixed the prompt thing.

    but now i think i broke the other machine...

    tux no longer lets me onto the ftp server...FUCK
    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 ?

  9. Default

    Quote Originally Posted by acolyte_to_jippity View Post
    well, like i said. i fixed the prompt thing.

    but now i think i broke the other machine...

    tux no longer lets me onto the ftp server...FUCK
    Are you able to get to the banner or user/pass prompt on it? If not, check netstat -ant (not sure how that translates to solaris) and see if anything is listening on port21.
    Kiro : us fireyes got dumb by his girl that y he is suck

  10. Default

    Quote Originally Posted by Fireye View Post
    Are you able to get to the banner or user/pass prompt on it? If not, check netstat -ant (not sure how that translates to solaris) and see if anything is listening on port21.
    well, the other machine's one works fine (dunx1).

    i can log onto tux using the ssh client, but the ftp won't connect when i open a session (i use Secure Shell ssh)

    edit: netstant -ant gave me alot of stuff, but:

    tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN



    i'm pretty sure it's port 22 for me

    edit edit: ahhhh, tux is not solaris.

    bash --version:
    Code:
    GNU bash, version 3.2.48(1)-release (x86_64-pc-linux-gnu)
    Copyright (C) 2007 Free Software Foundation, Inc.
    uname -a:
    Code:
    Linux tux64-12.cs.drexel.edu 2.6.29-8-cs-np #9 SMP Sun Aug 16 00:46:06 EDT 2009 x86_64 GNU/Linux
    lsb_release -a:
    Code:
    No LSB modules are available.
    Distributor ID: Ubuntu
    Description:    Ubuntu 9.04
    Release:        9.04
    Codename:       jaunty
    Last edited by acolyte_to_jippity; 10-20-2010 at 12:47 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
  •