I tried using cat /opt/mqm/samp/amqscos0.txt | sudo -u mqm runmqsc COLIN and it failed, complaining about su syntax.
I solved it by
sudo -u mqm cat /opt/mqm/samp/amqscos0.txt | sudo -u mqm runmqsc COLIN
Easy when you know how!
I tried using cat /opt/mqm/samp/amqscos0.txt | sudo -u mqm runmqsc COLIN and it failed, complaining about su syntax.
I solved it by
sudo -u mqm cat /opt/mqm/samp/amqscos0.txt | sudo -u mqm runmqsc COLIN
Easy when you know how!
This may work as well:
sudo -u mqm “runmqsc COLIN < opt/mqm/samp/amqscos0.txt"
The quotes may not be required, I do my have sudo to try with.
LikeLike
Thank you – very useful
LikeLike
When I run the original command, it works fine, apart from having to use the extension ‘.tst’ instead of ‘.txt’.
I’d be curious to know what error you got!
LikeLike
Good spot. I ran it on another machine, and typed in it by hand.!
LikeLike