How to call different programs based on requirement?


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting How to call different programs based on requirement?
# 15  
Old 05-28-2012
Hi Sinari,

Here i have to findout two things.. one is software version and another one is sever type(Linux,solaris,etc..), in that scenario how does it(case) work?
i use two commands to get software version "mqver" and "dspmqver" and i use "uname" to get the server type. By using these commands can you tell me how can i keep all my scripts in one script
# 16  
Old 05-28-2012
Something like this....

Code:
syst=$(uname -s)
case "$syst" in
             "AIX") swver=$(mqver)
                    case "$swver" in
	                            "1.01") <script 1>;;
		                    "1.02") <script 2>;;
		    esac;;
	   "SunOS") swver=$(dspmqver)
                    case "$swver" in
	                            "1.1") <script 3>;;
		                    "1.2") <script 4>;;
		    esac;;
esac

# 17  
Old 05-28-2012
Hi Sinari,

I tried with below code to check whether it is working or not, but it didn't give any output Smilie

Code:
#!/bin/ksh
syst=$(uname -s)
case "$syst" in
             "SunOS")
                    swver=$(mqver)
                    case "$swver" in
                                    "5.3") echo "one";;
                    esac;;
              "SunOS")
                    swver=$(dspmqver)
                    case "$swver" in
                                    "6.0.2.1") echo "three";;
                    esac;;
esac


Last edited by darling; 05-28-2012 at 11:33 AM..
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Call script parameter based on dates

Hi Guys, I am having a script which needs to be iterated based on date passed and itrate based on no of months given. #!/bin/bash var_d=$1 months=$2 sh invoke_script var_d i need to iterate the inside script something like below sh invoke_script 170101 sh invoke_script... (4 Replies)
Discussion started by: Master_Mind
4 Replies

2. Shell Programming and Scripting

awk script to call another script based on second column entry

Hi I have a text file (Input.txt) with two column entries separated by tab as given below: aaa str1 bbb str2 cccccc str3 dddd str4 eee str3 ssss str2 sdf str3 hhh str1 fff str2 ccc str3 ..... ..... ..... (1 Reply)
Discussion started by: my_Perl
1 Replies

3. UNIX for Dummies Questions & Answers

Difference between inbuilt suid programs and user defined root suid programs under bash shell?

Hey guys, Suppose i run passwd via bash shell. It is a suid program, which temporarily runs as root(owner) and modifies the user entries. However, when i write a C file and give 4755 permission and root ownership to the 'a.out' file , it doesn't run as root in bash shell. I verified this by... (2 Replies)
Discussion started by: syncmaster
2 Replies

4. Shell Programming and Scripting

KSH - How to call different scripts from master scripts based on a column in an Oracle table

Dear Members, I have a table REQUESTS in Oracle which has an attribute REQUEST_ACTION. The entries in REQUEST_ACTION are like, ME, MD, ND, NE etc. I would like to create a script which will will call other scripts based on the request action. Can we directly read from the REQUEST_ACTION... (2 Replies)
Discussion started by: Yoodit
2 Replies

5. UNIX for Dummies Questions & Answers

Are programs like sys_open( ) ,sys_read( ) et al examples of system level programs ?

Are the programs written on schedulers ,thread library , process management, memory management, et al called systems programs ? How are they different from the programs that implement functions like open() , printf() , scanf() , read() .. they have a prefix sys_open, sys_close, sys_read etc , right... (1 Reply)
Discussion started by: vishwamitra
1 Replies

6. UNIX for Dummies Questions & Answers

how to call two programs simultaneously

Hi, i want to call two programs simultaneously from a currently running program so as to distribute the job and fasten the speed. As of now I call the programs one after the other within the main program. e.g. `perl A.pl`; `perl B.pl`; how can I run the two paralelly? urgent ... please... (1 Reply)
Discussion started by: vipinccmb
1 Replies

7. Shell Programming and Scripting

Perl call C programs

Hi, I am a beginner in Perl programming. Now i need to call a C program from a perl program ...Can any one please help me and give any details how i can do this. Thanks and Regards (3 Replies)
Discussion started by: gjithin
3 Replies

8. Shell Programming and Scripting

Picking the file based on Date..Requirement

Dear frnds My requirement is as follows -rw-r----- 1 f02 dd 109428250 May 18 14:02 Extracts_20070518104730.zip -rw-r----- 1 f02 dd 109493187 May 21 13:30 Extracts_20070521091700.zip -rw-r----- 1 f02 dd 109993058 May 23 14:14 Extracts_20070523085955.zip -rw-r----- 1... (5 Replies)
Discussion started by: sureshg_sampat
5 Replies

9. Programming

call functions from diferents programs

hi i have ten program in C, and there are functions what are in all the programs. so, i want to make a directory to store all the functions what are in all the programs, and call them from the C programs. (sending variables and values) is that possible?¿? how ca i do that?¿? any idea,... (1 Reply)
Discussion started by: DebianJ
1 Replies
Login or Register to Ask a Question