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, ...
- 03-12-2008 #1
Greeting script...
Hello all,
Got another question...
I have an entry in my .bashrc like this...
I know I can do this...echo -ne "${BLUE}""Howdy. Today is, "; date
My question is this, how can I have the "real name" displayed...echo -ne "${BLUE}""Howdy, $USER Today is, "; date
So the message would say...
Howdy Kevin, Today is... etc, rather then Howdy "username"
Is it possible?
- 03-12-2008 #2
Just replace $USER with actual name.
You can write anything you want.Code:echo -ne "${BLUE}""Howdy, Kevin Today is, "; dateIt is amazing what you can accomplish if you do not care who gets the credit.
New Users: Read This First
- 03-12-2008 #3Linux Engineer
- 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, drlWelcome - 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 )
- 03-12-2008 #4
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.


Reply With Quote