Author |
Message
|
krypton |
Posted: Thu May 31, 2018 8:40 am Post subject: Some help with MQSC script |
|
|
 Disciple
Joined: 14 Mar 2010 Posts: 166
|
I am trying to combine these 2 statements in a single loop but not having any luck, can someone guide me through it.
By itself both the while statements are working.
while true ; do echo "dis chs(ABC.XYZ.SN) msgs" | runmqsc UNPRDQM1 & sleep 1; done
while true ; do echo "dis chs(XYZ.ABC.SN) msgs" | runmqsc UNPRDQM1 & sleep 1; done _________________ Dreams are not something which you watch when you are asleep,it is something which doesn't let you sleep. |
|
Back to top |
|
 |
Vitor |
Posted: Thu May 31, 2018 11:06 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 25462 Location: Ohio, USA
|
What goes wrong?
If this is how you're monitoring channel status on your appliance, are you sure this is the best way? _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
gbaddeley |
Posted: Thu May 31, 2018 3:33 pm Post subject: |
|
|
 Padawan
Joined: 25 Mar 2003 Posts: 1919 Location: Melbourne, Australia
|
& creates a background process.
&& or ; should work OK.
while true ; do echo "dis chs(ABC.XYZ.SN) msgs\ndis chs(ABC.ABC.SN) msgs" | runmqsc UNPRDQM1 ; sleep 1 ; done
worked for me in ksh.
Why do you want to do these chs commands? There may be a better approach.... _________________ Glenn |
|
Back to top |
|
 |
krypton |
Posted: Fri Jun 01, 2018 4:20 am Post subject: |
|
|
 Disciple
Joined: 14 Mar 2010 Posts: 166
|
Quote: |
What goes wrong?
If this is how you're monitoring channel status on your appliance, are you sure this is the best way? |
Hi Vitor, thank you for replying, this is not for all time monitoring, only when application says they are sending request and not getting reply, I want to see if the msgs count increase at the same time on both sender or receiver channel or not. So, that I can pinpoint the issue.
so, this is not something i am planning to do 24*7. _________________ Dreams are not something which you watch when you are asleep,it is something which doesn't let you sleep. |
|
Back to top |
|
 |
krypton |
Posted: Fri Jun 01, 2018 4:25 am Post subject: |
|
|
 Disciple
Joined: 14 Mar 2010 Posts: 166
|
Hi Glenn,
thank you, it worked now.
Quote: |
Why do you want to do these chs commands? There may be a better approach....
|
mentioned in the other reply, it is only for troubleshooting purpose. _________________ Dreams are not something which you watch when you are asleep,it is something which doesn't let you sleep. |
|
Back to top |
|
 |
|