1830898 Members
2731 Online
110017 Solutions
New Discussion

Shell Wrapper

 
Hunki
Super Advisor

Shell Wrapper

I have this tuxedo qmadmin ( similar to sqlplus )command which opens up a session to clear the tuxedo queues.As most the reps here do not know tuxedo,I need to create a shell wrapper for them to execute.

Here is the wrapper I am trying to create:
-----------------------------------------------
#!/usr/bin/ksh

. /aqq/dolid/test/cur/admin/tux/.profile
cat ubbsource |grep OPEN|grep "/appl/solid"|grep -v "/tux"
echo "Select Queue Name and Path"
read resp1
qmadmin $resp1
!echo "Open the queue space using the name from above"
!read resp2 #this is where its not working ..how to make it read the response #once inside the qmadmin
qopen $resp2
!echo "Doing qinfo now, look for all ErrHold Queues"
qinfo
q
!

----------------------------------------------
3 REPLIES 3
Peter Nikitka
Honored Contributor

Re: Shell Wrapper

Hi,

it is hard to check what you really wont - so I try to guess:
- qmadmin reads tuxedo commands from stdin

...
read resp1
qmadmin $resp1 <cmd1
cmd2
EOF

The resulting output will be in $resp2, and you can analyze this output to get further information, e.g.

myinfo=$(print "$resp2" | awk ...)
qmadmin $resp1 <cmd3 $myinfo
cmd4 $resp1
EOF

mfG Peter

The Universe is a pretty big place, it's bigger than anything anyone has ever dreamed of before. So if it's just us, seems like an awful waste of space, right? Jodie Foster in "Contact"
RAC_1
Honored Contributor

Re: Shell Wrapper

Two ways to do it.

echo "your_choice1 your_choice2" | qmadmin
(Depends on qmadmin command. It may work or may not)

Otherwise use here document.

qmadmin first_arg << END
command1
command2
END
There is no substitute to HARDWORK
Ninad_1
Honored Contributor

Re: Shell Wrapper

Hunki,

What are you expecting the user to do after
!echo "Open the queue space using the name from above" ???
Are you expecting the user to run some command ?? If yes cant you yourself run the command in the script as the user has alerady provided the queue name as alerady suggested by others.

qmadmin $resp1 <> logfile
qopen $resp1
!echo "Doing qinfo now, look for all ErrHold Queues"
qinfo
q
!
EOF

Hope this helps,
Ninad