I noticed that the application that is run is called Mintty. To get the help file, just type mintty --help at the terminal. I was not interested in the --icon option, but the --exec option looked promising.
This got me thinking of what I wanted to execute using Mintty. I needed to execute my Perl script using bash. After some trial and error, I was successful in executing the Perl script. This is what I came up with. The bash help files are also helpful so from the terminal type bash --help or bash -c "help set".
This would execute the Perl script with bash running in Mintty. I needed the standard output as this is what I parse to determine if the script was successful or not. This is very easily solved by piping the standard output from the script to a file and then get LabVIEW to read the file once the script exits.
This does add an extra step, but by executing the script in this way, it runs and exits cleanly every time, being much more reliable than using the batch file. This is my final string that was used. After trying both methods, I settled on using Mintty instead of Windows batch files. They seemed a lot more reliable over many executions. This method can surely be expanded to running Python scripts too, which I will leave for another day. Necessary cookies are absolutely essential for the website to function properly.
You should upgrade or use an alternative browser. Running exe using PERL. Thread starter sivamit Start date Feb 4, Status Not open for further replies.
Is it possible to run other e. Thanks in advance.. There is more than one way to do these things, look them up in the Perl help files. Can we implement this..? Thank you..!!! But assuming you had an excel file called 'test. Similar threads E. Regarding running of. PC Programming and Interfacing. Remove repeated line using Perl.
You can use it to run execute all types of operating system commands, even on Windows platforms. For instance, here is a similar example that will run on a Windows system:. To make our "Perl execute" example even more powerful, you can use Perl variables inside of the backtick operators.
This is very helpful inside of actual programs. For instance, instead of hard-coding the name of my home directory into the command in the previous example, we can imagine that this is running inside of a more complicated program, and that a variable was used to store the name of users home directory. Here's the same Perl exec example as above, with the inclusion of a variable to store the users home directory:.
Here's another tip that really doesn't have anything to do with the Perl backtick operator, but can be very useful for this example. Instead of storing the output in a scalar variable, you can store each individual line of output in an array variable. Then, once you have the information stored in an array, you can more easily work with one line at a time inside of your program.
Here's the same Perl exec example one more time, this time with the output of the directory listing being stored in an array or list if you prefer , where each line is printed out one record at a time:.
0コメント