Sponsored Content
Full Discussion: running test
Operating Systems Linux running test Post 302182502 by skooly5 on Sunday 6th of April 2008 11:01:31 PM
Old 04-07-2008
running test

--------------------------------------------------------------------------------

I am running a test command and if the user is not found you have to type exit and it wiil exit. Ok I did that. But if the user is found it is supposed to finger them. But my problem is it makes you type exit first then it fingers them. Why? whats wrong?

if [ -z username ]
then
error_fn
else
echo "Please try again or type exit to quit"
read exit"
if grep "$username" /etc/passwd
then
finger "$username"
fi
fi

I must have something switched around huh?
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Script to Test Application Server is running

Hi, I'm a complete novice at Unix and need to create a script that does the following... checks to see if an application server is running. If the app is running then print 'Available' Else print 'Unavaliable' exit from scriopt I have no idea where to start. I'd be very grateful... (0 Replies)
Discussion started by: duglover
0 Replies

2. Shell Programming and Scripting

Script to test for scripts running

Hi, Im writing a script that will check which scripts are running. The script will run on a 5min loop and the status of the scripts will be written to the log. If any of the scripts arent running an email will be sent out. At the min if all scripts are running an entry is made to the log... (19 Replies)
Discussion started by: runnerpaul
19 Replies

3. Shell Programming and Scripting

Test on string containing spacewhile test 1 -eq 1 do read a $a if test $a = quitC then break fi d

This is the code: while test 1 -eq 1 do read a $a if test $a = stop then break fi done I read a command on every loop an execute it. I check if the string equals the word stop to end the loop,but it say that I gave too many arguments to test. For example echo hello. Now the... (1 Reply)
Discussion started by: Max89
1 Replies

4. Shell Programming and Scripting

How to check weather a string is like test* or test* ot *test* in if condition

How to check weather a string is like test* or test* ot *test* in if condition (5 Replies)
Discussion started by: johnjerome
5 Replies

5. Infrastructure Monitoring

Test if Oracle listener is running

Hi All , I am new to shall scripting, i want write an script for oracle tns and listener. If tns working i want o/p as "Listener and TNS are working" else o/p should be ""Listener and TNS are not Working" below is the command in unix to check the tns status, if no output it means TNS... (3 Replies)
Discussion started by: abdul bari
3 Replies

6. Linux

YUM HANGS AT RUNNING TRANSACTION TEST

Hi When i trying to update using yum, hangs at Running transaction test. # yum update yum Loaded plugins: fastestmirror Loading mirror speeds from cached hostfile * addons: ftp.oss.eznetsols.org * extras: ftp.oss.eznetsols.org * base: ftp.oss.eznetsols.org * updates:... (2 Replies)
Discussion started by: anil8103
2 Replies

7. Shell Programming and Scripting

Backup script / Test if script is already running

Hello everyone, I have 2 questions : 1) I have a backup shell script, let's call it backup.sh, that is called every hour as a cron job. As a matter of fact a backup could last more than one hour. It mounts a NAS and then do some rsync on important directories, so really I don't want to... (2 Replies)
Discussion started by: freddie50
2 Replies

8. Solaris

Test program running taking much more time on high end server T5440 than low end server T5220

Hi all, I have written the following program and run on both T5440 and T5220 on same OS version. I found that T5540 server takes more time than T5220. Please find below the details. test1.cpp #include <iostream> #include <pthread.h> using namespace std; #define NUM_OF_THREADS 20... (17 Replies)
Discussion started by: sanjay_singh85
17 Replies

9. Shell Programming and Scripting

Running test command in ssh

I tried to run the following commands in my shell script. This command works fine for me: ssh -n "${username}"@"${hostname}" "grep WARNING ${serverhome}/${serverlog} | wc -l" The result is: 1548 However when i try to run a similar one: ssh -n "${username}"@"${hostname}" "test `grep -q... (2 Replies)
Discussion started by: hys1117
2 Replies

10. Shell Programming and Scripting

Test if Remote server is up and running before SFTP'ing files (in batch mode)

Hello, In our Data Warehouse environment, before our batch SFTP jobs kick off to pull the files from remote servers, I would like to setup a pre-sftp job that would test if all the remote servers from where the files are being pulled, are up and running. If any one of the remote serer is... (2 Replies)
Discussion started by: Dippu
2 Replies
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.10 6 Nov 2000 finger(1)
All times are GMT -4. The time now is 10:44 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy