11-07-2005
How to input username on text file into finger command on shell script
I'm trying to clean up my server and I have the list of some "special" users stored on the text file like this
Now I want to write a shell script to finger all of them so I can have some kind of ideas who they are but here comes the problem....I completely forgot how to do it with shell script
(it has been such a long time since I wrote one anyway). Please do not tell me to do it manually since it has about 300 username on the list (gonna take forever to do it
)
So I reallie appreicate if anyone here can give me some kind of advice on how to do it. I'm having problem trying to figure out how to take the username on the text file and input them into the finger command (maybe using while but hmm...)
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
Hi, I have a file named 'uname' that contains just an username and try to redirect the content of the file to finger:
$cat uname | finger
But finger always shows info for all users, instead of just the one I have in the file.
I would appreciate any help.
Thanks,
David (2 Replies)
Discussion started by: dhinojosa
2 Replies
2. Shell Programming and Scripting
This is my senario.....
The user enters a userid into linux.
((I have have already scripted the command to read this userid.))
I need help in writing the script so It reads the userID and in conjuction w/ the finger command displays to the user "no plan" on the screen (so the user reads/sees... (4 Replies)
Discussion started by: apolishuk
4 Replies
3. Shell Programming and Scripting
Hi,
I have data in my text file something like this.
adams
robert
ahmed
gibbs
I want to use this data line by line as input to an sql query which i run by connecting to an oracle database from shell.
If you have code for similar scenario , please ehlp.
I want the output of the sql query... (7 Replies)
Discussion started by: rdhanek
7 Replies
4. Shell Programming and Scripting
Hello friends,
I want a command to print the reult files from find command into a text file.:)
Iam looking from forum memebers. PLZ help me.ASAP
Thanks in Advance,
Siva Ranganath CH (5 Replies)
Discussion started by: sivaranga001
5 Replies
5. Shell Programming and Scripting
HI all,
I want to script where all the server names will be in a text file like
server1
server2
server3 . and the script should take servernames from a text file and perform copy of files if the files are not present on those servers.after which it should take next servername till the end of... (0 Replies)
Discussion started by: joseph.dmello
0 Replies
6. Shell Programming and Scripting
Hi,
I have the output (as below) which i want it to be in a table.
For e.g.
space utilization in PSE on path /logs is 0%
space utilization in PSE on path /logs/tuxedo/tuxlsp is 16%
space utilization in PSE on path /ldvarlsp/lsp/log is 37%
space utilization in PSE on path /home is 6%... (7 Replies)
Discussion started by: pkbond
7 Replies
7. Shell Programming and Scripting
The scope of the shell/perl script is to read the input text file. Validate the expiry date of each certificate and send the mail to the user. The user takes action to add the new certificate to the storage file and user owns the responsibility to update the input text file with the new certificate... (5 Replies)
Discussion started by: casmo
5 Replies
8. Shell Programming and Scripting
Hi,
We are having a java server which can run on command line and once initiated, it will prompt options to enter from 0 to 5. The java program kickoff respective operation once number is entered between 0 to 5. However i want to always enter "1" and write another shell program wrapper to start... (4 Replies)
Discussion started by: surya5kn
4 Replies
9. UNIX for Dummies Questions & Answers
Dear experts,
I am new to linux programming. I have a shell script which i should run it on all my samples.
I only define input and out put for this script. The inputs are 3 numbers(coordination numbers) which are available in a series of text file.
Since i have a lots of samples, it takes a... (5 Replies)
Discussion started by: mohamadreza
5 Replies
10. UNIX for Beginners Questions & Answers
//file begin =====
//some code
task abcd_;
input x;
input y,z; //some comment
output w; //some comment
reg p;
integer q;
begin
//some code
end
endtask : abcd_
//some code
//file end =====
expected output from above... (1 Reply)
Discussion started by: rishifrnds
1 Replies
LEARN ABOUT OPENSOLARIS
finger
finger(1) User Commands finger(1)
NAME
finger - display information about local and remote users
SYNOPSIS
finger [-bfhilmpqsw] [username]...
finger [-l]
[username@hostname 1 [@hostname 2 .. .@hostname n]...]
finger [-l] [@hostname 1 [@hostname 2 .. .@hostname n]...]
DESCRIPTION
By default, the finger command displays in multi-column format the following information about each logged-in user:
o user name
o user's full name
o terminal name (prepended with a `*' (asterisk) if write-permission is denied)
o idle time
o login time
o host name, if logged in remotely
Idle time is in minutes if it is a single integer, in hours and minutes if a `:' (colon) is present, or in days and hours if a `d' is
present.
When one or more username arguments are given, more detailed information is given for each username specified, whether they are logged in
or not. username must be that of a local user, and may be a first or last name, or an account name. Information is presented in multi-line
format as follows:
o the user name and the user's full name
o the user's home directory and login shell
o time the user logged in if currently logged in, or the time the user last logged in; and the terminal or host from which the
user logged in
o last time the user received mail, and the last time the user read mail
o the first line of the $HOME/.project file, if it exists
o the contents of the $HOME/.plan file, if it exists
Note: when the comment (GECOS) field in /etc/passwd includes a comma, finger does not display the information following the comma.
If the arguments username@hostname1[@hostname2...@hostnamen] or @hostname1[@hostname2...@hostnamen] are used, the request is sent first to
hostnamen and forwarded through each hostnamen-1 to hostname1. The program uses the finger user information protocol (see RFC 1288) to
query that remote host for information about the named user (if username is specified), or about each logged-in user. The information dis-
played is server dependent.
As required by RFC 1288, finger passes only printable, 7-bit ASCII data. This behavior may be modified by a system administrator by using
the PASS option in /etc/default/finger. Specifying PASS=low allows all characters less than decimal 32 ASCII. Specifying PASS=high allows
all characters greater than decimal 126 ASCII. PASS=low,high or PASS=high,low allows both characters less than 32 and greater than 126 to
pass through.
OPTIONS
The following options are supported, except that the username@hostname form supports only the -l option:
-b Suppresses printing the user's home directory and shell in a long format printout.
-f Suppresses printing the header that is normally printed in a non-long format printout.
-h Suppresses printing of the .project file in a long format printout.
-i Forces "idle" output format, which is similar to short format except that only the login name, terminal, login time, and idle time
are printed.
-l Forces long output format.
-m Matches arguments only on user name (not first or last name).
-p Suppresses printing of the .plan file in a long format printout.
-q Forces quick output format, which is similar to short format except that only the login name, terminal, and login time are printed.
-s Forces short output format.
-w Suppresses printing the full name in a short format printout.
FILES
$HOME/.plan user's plan
$HOME/.project user's projects
/etc/default/finger finger options file
/etc/passwd password file
/var/adm/lastlog time of last login
/var/adm/utmpx accounting
ATTRIBUTES
See attributes(5) for descriptions of the following attributes:
+-----------------------------+-----------------------------+
| ATTRIBUTE TYPE | ATTRIBUTE VALUE |
+-----------------------------+-----------------------------+
|Availability |SUNWrcmds |
+-----------------------------+-----------------------------+
SEE ALSO
passwd(1), who(1), whois(1), passwd(4), attributes(5)
Zimmerman, D., The Finger User Information Protocol, RFC 1288, Center for Discrete Mathematics and Theoretical Computer Science (DIMACS),
Rutgers University, December 1991.
NOTES
The finger user information protocol limits the options that may be used with the remote form of this command.
SunOS 5.11 6 Nov 2000 finger(1)