Find the answer to your Linux question:
Results 1 to 4 of 4
Is it possible to customize the prompt in Linux with custom text? We install software on customers servers, I'd like to have what version of software they are using at ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Jul 2010
    Posts
    15

    How to customize prompt WITH custom text


    Is it possible to customize the prompt in Linux with custom text?

    We install software on customers servers, I'd like to have what version of software they are using at my display prompt.

    How?

  2. #2
    Trusted Penguin Irithori's Avatar
    Join Date
    May 2009
    Location
    Munich
    Posts
    3,356
    Yes, it is possible:
    Bash Prompt HOWTO: Bash and Bash Prompts

    Also, there is the /etc/motd file.

    That said, are you sure this is a good idea?
    Essentially this is advertisement and adds nothing to the useability.
    In contrast, it takes away space and possibly even the preferred custom config of your customers.

    I would not be pleased and you would surely get "feedback".

    Versioninformation should be where it is expected.
    In the deb/rpm package.
    So that it can be queried with standard tools
    You must always face the curtain with a bow.

  3. #3
    Just Joined!
    Join Date
    Jul 2010
    Posts
    15
    Customers never login to their servers, they only use web interface. It is strictly developers logging in and making changes. It would be handy to know what version of our software is running within the command prompt.

    Read the bash and bash prompts but I don't see anything on customizing your own text. I'd like a prompt like: [root@ofca3 -VERSION4.2.1 ~]#

    I've looked for a few hours and don't yet see a way to use your own custom

  4. #4
    Trusted Penguin Irithori's Avatar
    Join Date
    May 2009
    Location
    Munich
    Posts
    3,356
    Like this?
    Code:
    PS1="[\u@\h-VERSION4.2.1 ]\w\$"
    It is your choice of course, but the fact that only developers login actually strengthens my point.
    Because this is a group of people, that is capable of and prone to change settings.
    Likewise, they would know how to rpm -qi <YOUR_APP> or dpkg -s <YOUR_APP>
    You must always face the curtain with a bow.

Posting Permissions

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