Mirth Community

Mirth Community (http://www.mirthcorp.com/community/forums/index.php)
-   Support (http://www.mirthcorp.com/community/forums/forumdisplay.php?f=6)
-   -   How to execute linux commands (http://www.mirthcorp.com/community/forums/showthread.php?t=216533)

mpa 09-26-2016 06:36 AM

How to execute linux commands
 
Hi all,

I'm new to Mirth Connect and my first impression - it is a very powerful integration engine and provides a lot of integrated solutions, but I have some problems with decode (later also encode) zip Files. I have found some threads (http://www.mirthproject.org/communit...ead.php?t=3909) but they don't really help me. I need some solution where I can work with scripting or at least I can execute Linux Command like (for example unzip with 7zip). Please, help me to find some solution.

Best regards

mpa

siddharth 09-26-2016 08:18 AM

If your problem is zipping/Unzipping a file, you can do through Java script. The code is in the link you have.

If your problem is executing a windows command through Mirth, that can be done but will be very tedious to achieve, through this

java.lang.Runtime.getRuntime().exec("system_comman d");

But there will be lot of modifications you need to make in it.

mpa 09-30-2016 04:00 AM

Hi siddharth,

the code from the link above doesn't work for me, probably I do something wrong...

Sooner or later I will need the possibility to execute shell scripts and other cli's commands. It would be helpful and nice from you if you could help me a little bit on this way.

Sorry for my english!

Best regards

mpa

robrud 10-11-2016 04:33 AM

Shell Scripts
 
Hi,

Here my codesnippet from a Source-Transformer calculating the MD5-Sum on a Ubuntu OS. Mirth 3.3.2. If you search the Forum for getRuntime.exec you'll find a lot of other examples for executing shell commands.

Code:

var md5p = java.lang.Runtime.getRuntime().exec('md5sum /.../' + sourceMap.get('originalFilename'));
md5p.waitFor();
var md5is = md5p.getInputStream();
var md5content = org.apache.commons.io.IOUtils.toString(md5is);



All times are GMT -8. The time now is 11:38 PM.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2019, vBulletin Solutions, Inc.
Mirth Corporation