Find the answer to your Linux question:
Results 1 to 4 of 4
Hello all, Got another question... I have an entry in my .bashrc like this... echo -ne "${BLUE}""Howdy. Today is, "; date I know I can do this... echo -ne "${BLUE}""Howdy, ...
  1. #1
    Linux Newbie AboveNBeyond's Avatar
    Join Date
    Mar 2007
    Posts
    120

    Greeting script...

    Hello all,
    Got another question...

    I have an entry in my .bashrc like this...
    echo -ne "${BLUE}""Howdy. Today is, "; date
    I know I can do this...
    echo -ne "${BLUE}""Howdy, $USER Today is, "; date
    My question is this, how can I have the "real name" displayed...

    So the message would say...
    Howdy Kevin, Today is... etc, rather then Howdy "username"

    Is it possible?

  2. #2
    Super Moderator devils casper's Avatar
    Join Date
    Jun 2006
    Location
    Chandigarh, India
    Posts
    24,316
    Just replace $USER with actual name.
    Code:
    echo -ne "${BLUE}""Howdy, Kevin Today is, "; date
    You can write anything you want.
    It is amazing what you can accomplish if you do not care who gets the credit.
    New Users: Read This First

  3. #3
    drl
    drl is offline
    Linux Engineer drl's Avatar
    Join Date
    Apr 2006
    Location
    Saint Paul, MN, USA / CentOS, Debian, Solaris, SuSE
    Posts
    1,117
    Hi.

    The fifth field in file /etc/passwd contains the "full name" (or a comment) for each user login name. See the man pages for passwd in sections 1 and 5.

    You can extract the field with utilities, for example grep and cut ... cheers, drl
    Welcome - get the most out of the forum by reading forum basics and guidelines: click here.
    90% of questions can be answered by using man pages, Quick Search, Advanced Search, Google search, Wikipedia.
    We look forward to helping you with the challenge of the other 10%.
    ( Mn, 2.6.n, AMD-64 3000+, ASUS A8V Deluxe, 1 GB, SATA + IDE, Matrox G400 AGP )

  4. #4
    Linux Newbie AboveNBeyond's Avatar
    Join Date
    Mar 2007
    Posts
    120
    Devils_casper, you are correct, but I want this .bashrc entry to be on the /etc/bashrc for all users. So I would like it to be their name, not mine.

    drl, I will look into it, thanks.

Posting Permissions

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