Find the answer to your Linux question:
Results 1 to 9 of 9
I have two Linux Enterprise 4.0 servers; when l log in to one of the servers, i get a > prompt logging in as root and when i log in ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Feb 2008
    Posts
    3

    Changing my prompt


    I have two Linux Enterprise 4.0 servers; when l log in to one of the servers, i get a > prompt logging in as root and when i log in to the other one, i get $ or # sometime. I really want the prompt to be > instead of others. What do i need to do to make the prompt be > ? please help.

  2. #2
    Linux User Oxygen's Avatar
    Join Date
    Jul 2004
    Location
    Hartlepool, England
    Posts
    392
    I don't see how that matters...

    $ is displayed when you login as a user and
    # means you're on a root shell
    Graham - You'd better Use Linux!

    I'm registerd Linux user #397030. What about you?

  3. #3
    Linux Guru
    Join Date
    Nov 2007
    Location
    Córdoba (Spain)
    Posts
    1,513
    Quote Originally Posted by yotomi View Post
    I have two Linux Enterprise 4.0 servers; when l log in to one of the servers, i get a > prompt logging in as root and when i log in to the other one, i get $ or # sometime. I really want the prompt to be > instead of others. What do i need to do to make the prompt be > ? please help.
    How you can set your prompt entirely depends on the shell that you are using. So, after login in, type this to know what your shell is:

    Code:
    echo $SHELL
    But, really, you should abide to the $ and # forms unless you know what you are doing. And I say that because it's always a good idea to know if you are root or a regular user.

    In any case, once you know the shell that you are using, we can orientate you better on how to setup your shell prompt. For example, bash sets the prompt variable PS1 into ~/.bashrc or ~/.bash_profile, depending on what you are trying to achieve.

  4. #4
    Just Joined!
    Join Date
    Feb 2008
    Posts
    3
    Thanks a lot. The reason why I think it matters is because I have an application installed on both servers and I import some data into directories on these two servers. I have not been successful in importing to the one with $ and/or #, but the one with > has been the only one that goes through.
    Below is the command issued:

    incadmin@ipmanagement:/opt/incontrol...tChildblock.sh -u incadmin -p identity -f imports/RichCoreblock.csv -e imports/RichCoreblock.err -r imports/RichCoreblock.rej


    Works only on the servers with the > prompt and the ones with $ or #.

    How much confussion have i casued?

    By the way, the command above is supposed to make something happen in the application in question.

    what are your thoughts?

  5. #5
    Just Joined! kveldulf980's Avatar
    Join Date
    Apr 2008
    Location
    New Jersey
    Posts
    15
    There shouldn't be any reason why one shell would carry out an execute command differently than any other. What is the program you are trying to run there? I can't find anything about it so I am guessing it's a homemade shell script, obviously the first two parameters are username and password, the next imports a file of comma separated values of something to block (who knows what) the next is the error reporting file. Ah but the last parameter, I've seen rej files in LDAP commands, they are used to log changes in slurpd, or slapd, I forget.

    So my final assesment is that this is a script that logs you into an LDAP server, alters a database using the values from RichCoreblock.csv, reports any errors to the next file, and records changes in the rej file.

    Just a guess.

  6. #6
    scm
    scm is offline
    Linux Engineer
    Join Date
    Feb 2005
    Posts
    1,044
    Code:
    export PS1="> "
    will do what you want.

    Shells have a number of prompt variables, PS1 being the one you usually see, and PS2 is used for continuation lines (this is usually >). man bash for the rest.

  7. #7
    Linux Guru
    Join Date
    Nov 2007
    Location
    Córdoba (Spain)
    Posts
    1,513
    The thing is that the prompt has nothing to do with you being able to run that command or not, it's just a cosmetical/informative thing.

  8. #8
    Just Joined!
    Join Date
    Feb 2008
    Posts
    3
    you were right every step of the way. you guessed correctly. so there

  9. #9
    Just Joined! kveldulf980's Avatar
    Join Date
    Apr 2008
    Location
    New Jersey
    Posts
    15
    Quote Originally Posted by yotomi View Post
    you were right every step of the way. you guessed correctly. so there
    Haha, fun game.

Posting Permissions

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