Taking one input at a time


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Taking one input at a time
# 8  
Old 06-23-2011
Quote:
Originally Posted by radoulov
What this statement means:



If both A and C are passed, the script will use only A.
No, Only A / B / C / D (One at a time will be passed by user)
# 9  
Old 06-23-2011
I don't understand. You said:

Quote:
If A is passed by user then, B C D will be ignored.
... so once A is passed, the script should use it and ignore the rest.
It will never see the C.
Am I missing something?
# 10  
Old 06-23-2011
Quote:
Originally Posted by radoulov
I don't understand. You said:

... so once A is passed, the script should use it and ignore the rest.
It will never see the C.
Am I missing something?
Right, if A is passed by User, it should ignore the rest.
If B is passed by user, it should ignore the rest

With Switch case, it works only for a finite list of systems, tomorrow if more systems are added, then i need to add more switches.

Is there any other way by manipulating the variable or something.

If, A is passed then (B C D) should go to exception list.
# 11  
Old 06-23-2011
If I understand correctly, you could handle only the systems you're interested in
and implement the correct precedence (their order in the case statement), you can just ignore the rest.

You should post a bigger part of the script so we can understand what exactly
you mean by: one at a time.
# 12  
Old 06-23-2011
Quote:
Originally Posted by radoulov
If I understand correctly, you could handle only the systems you're interested in
and implement the correct precedence (their order in the case statement), you can just ignore the rest.

You should post a bigger part of the script so we can understand what exactly
you mean by: one at a time.
Actually, no code is written so far.
These 4 systems are running with autosys jobs.
So, if system A has to be made active for autosys jobs, then the autosys jobs on system B C D should be ON-ICE
And, if system B is made active to run autosys jobs, then jobs on system system A C D should be ON-ICE and it continues...
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Problem in taking input Shell script

I was writing a shell script, where i need to run a command through script and then take input from user and later terminate it. i am not sure how to take input in a proper format immediately after a command. example: below command line is used to import some data in to database (LDAP)... (3 Replies)
Discussion started by: Mridul17
3 Replies

2. Shell Programming and Scripting

Process running time by taking user input

Need help in scripting . Below is the situation and need your inputs Checking all the processes, scripts running time based on user input time . Below Example ps -aef -o user,pid,etime,stime,args| grep sleep <user> 28995 01:24 14:14:39 sleep 120 <user> 29385 00:52 14:15:10... (8 Replies)
Discussion started by: ajayram_arya
8 Replies

3. UNIX for Dummies Questions & Answers

ls is taking long time to list

Hi, All the data are kept on Netapp using NFS. some directories are so fast when doing ls but few of them are slow. After doing few times, it becomes fast. Then again after few minutes, it becomes slow again. Can you advise what's going on? This one directory I am very interested is giving... (3 Replies)
Discussion started by: samnyc
3 Replies

4. UNIX for Dummies Questions & Answers

SED taking too much time

Hi I am trying to remove some characters from my data file. The data file has huge number of records say 90000 records. I am using sed for this purpose. eg : cat FILENAME|sed 's/;//g' (to remove semi colon ';') However as the data file is too huge , it is taking too much time to give... (3 Replies)
Discussion started by: dashing201
3 Replies

5. UNIX for Dummies Questions & Answers

Job is taking long time

Hi , We have 20 jobs are scheduled. In that one of our job is taking long time ,it's not completing. If we are not terminating it's running infinity time actually the job completion time is 5 minutes. The job is deleting some records from the table and two insert statements and one select... (7 Replies)
Discussion started by: ajaykumarkona
7 Replies

6. Shell Programming and Scripting

Problem while taking input from User

Hi All, I am facing a problem while taking input from user in Shell Script. Basically , I want to read a file line by line. And I want to remove certain lines of that file.But before removing those lines , I need to ask the user whether user wants to remove the lines. If user inputs "Yes" , the... (3 Replies)
Discussion started by: swapnil.nawale
3 Replies

7. UNIX for Dummies Questions & Answers

Taking a Users input to for the basis of a Grep

Hi I'm currently putting together a script that will grep a set of data for a particular input, specified by the user. I'm getting myself all tangled up with my Echo's and reads. What i'm looking to do is get it so that it prompts the user to enter a value (echo) and then uses their input... (5 Replies)
Discussion started by: Great Uncle Kip
5 Replies

8. Shell Programming and Scripting

Problem taking input from file with for loop

I am trying to take input from a file and direct it into a bash script. This script is meant to be a foreach loop. I would like the script to process each item in the list one by one and direct the output to a file. # cat 1loop #!/bin/bash # this 2>&1 to redirect STDERR & STDOUT to file... (4 Replies)
Discussion started by: bash_in_my_head
4 Replies

9. Shell Programming and Scripting

put an interactive script in background after taking input

i am trying to find a way to put an interactive script in the background after taking input from the user a few test lines i was trying: date echo "Enter location" LOCATION= read LOCATION sleep 100 sleep 200 date for this small example i want the script to as the user for the... (7 Replies)
Discussion started by: epsilonaurigae
7 Replies

10. UNIX for Advanced & Expert Users

Truss taking time in stopping

Hi Experts, I am starting my unix servers with truss cmd and taking truss output in a file . But when I run it for considerabely long time, it is not stopping easily on doing ^C ..... It is taking lotz of ctrl-C's to stop. Please let me know is there any other way to stop truss except ^C and... (1 Reply)
Discussion started by: aarora_98
1 Replies
Login or Register to Ask a Question