LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 04-29-2001, 07:23 PM   #1
delthrin
LQ Newbie
 
Registered: Apr 2001
Posts: 2

Rep: Reputation: 0
Question


How would i do this script using vi in bash with "if then"? I'm completely lost

Ok, I want you to write a script that will take a user name as input and if
the user name exist, print out each of the 7 fields used to represent the
user's account. Have a brief description of each field. The script must
include comments that explain how the script works. The script must use
positional parameters and check to make sure the correct number of arguments
exist. The script will be due 4/30 before 6:00 pm. For example:


./userinfo coleman

user name: coleman
password: x
User ID: 500
Group ID: 500
Comment: Chris Coleman
Home Dir: /home/coleman
Shell: /bin/bash

 
Old 04-30-2001, 05:01 AM   #2
webtoe
Member
 
Registered: Apr 2001
Location: Cambridge, England
Distribution: Slackware 10, Fedora Core 3, Mac OS X
Posts: 617

Rep: Reputation: 30
Unhappy

hope your not getting us to do your home work for you are we? :-)

all i know is that this scrit will need to have root permissions to be able to read the password file where all this information is kept.

unfotunatly i know little about scripts (except they need #!/bin/bash at the beggining and that you need to do: chmod a+x /directory/script_here to make it runnable).

looks like your time is running out

Alex

P.S.sorry
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Iptables (with masq) troubleshooting, very simple script attached script and logs. xinu Linux - Networking 13 11-01-2007 04:19 AM
python cgi script and premature end of script headers Neruocomp Programming 1 07-28-2005 11:43 AM
How to start a Tcl/Tk script by simply invoking the script file itself ? cyu021 Programming 2 10-10-2004 11:00 AM
send automatic input to a script called by another script in bash programming jorgecab Programming 2 04-01-2004 12:20 AM
linux 9 and java script error - premature end of script header sibil Linux - Newbie 0 01-06-2004 04:21 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 09:33 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration