running test


 
Thread Tools Search this Thread
Operating Systems Linux running test
# 1  
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?
# 2  
Old 04-07-2008
There are two different threads with basically exactly this question. Use the search facility in these forums, and read the forum rules -- using the forums to get your homework done for you is strongly discouraged.
# 3  
Old 04-07-2008
Double post, thread closed.

Continu here:

https://www.unix.com/unix-dummies-que...0004-test.html
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. 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

2. 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

3. 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

4. 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

5. 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

6. 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

7. 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

8. 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

9. 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

10. 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
Login or Register to Ask a Question