ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
There is less than 12 hours left to vote in the 2015 LinuxQuestions.org Members Choice Awards. Click here to go to the polls. Vote now and make sure your voice is heard!
Introduction to Linux - A Hands on Guide
This guide was created as an overview of the Linux Operating System, geared toward new users as an exploration tour and getting started guide, with exercises at the end of each chapter.
For more advanced trainees it can be a desktop reference, and a collection of the base knowledge needed to proceed with system and network administration. This book contains many real life examples derived from the author's experience as a Linux system and network administrator, trainer and consultant. They hope these examples will help you to get a better understanding of the Linux system and that you feel encouraged to try out things on your own.
Click Here to receive this Complete Guide absolutely free.
I want to write a simple script under UNIX\Linux OS, that finds your login in /etc/passwd
and prints your login and the following 3 logins to a HTML file (named logins.html) to a table.
I Know, that its easy, but I have some problems, and I can't find the error...
If anyone can help me...
Many many many thanks in advance!
Thank you for the info. This part is now working... But I want to put this information on a table. Th 1st column with the logins, teh 2nd column with the userIDs associated with the
logins in 1st column and the 3rd column with the home directories for the
logins in 1st column.
I would be gratefull if you could help me one more time. Iīll pay you a beer in Portugal or in Germany. Many thanks, Symbalino.
Many thank for the help, now the program is working very well!!!
But, the last thing that I need is, for example, if there is a parameter on the command line, I need that the script will print the datas for the login specified in that parameter.
Example for running the script:
1.) ./myscript -> prints the datas for your login and the following 3 logins in
2.) ./myscript xlogin25 -> the same for xlogin25
And this, really I dont Know how to do!!!
And I promess that this is My last post abou this script
if [[ ! "$myself" ]]
myself=$( whoami )
first=... [that ugly stuff]
Now, does this also earn me a beer?
oh. which ugly stuff you mean?
symbalino, how can you get such task if don't know some script language. we are talking here about basics. 10 s in google and you will find your answer. i gave you 90% of the information. if you want to refer the first command line parameter in your code use "$1". if you want the next three entries, you "-A 3" with grep. can you put the pieces together now?