<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=Windows-1252">
<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} </style>
</head>
<body dir="ltr">
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Hi Chris,</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<span style="color: rgb(0, 0, 0); font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt;">Since GATE 8.1 lots of condition can be performed within .mac files.</span><br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<span style="color: rgb(0, 0, 0); font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt;">As you said there are enable/disable commands:</span></div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
/control/if {alias1} == 1 test.mac</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
/control/doif {alias2} == 1 /geometry/test/run<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
There is also a command where you can look for a string (can be a string, a int or a float):</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<span style="font-family: Calibri, Arial, Helvetica, sans-serif; background-color: rgb(255, 255, 255); display: inline !important">/control/strif {alias3} == string1 some.mac</span></div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
/control/strif {alias3} != string2 other.mac<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Maybe this tool<span style="color: rgb(0, 0, 0); font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt;"> can be helpful for your problem. You can workaround your mac code to work fine with this tool or read the GATE help for more command tool
!</span></div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
Cheers,</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Émilie</div>
<div id="appendonsend"></div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
<br>
</div>
<hr tabindex="-1" style="display:inline-block; width:98%">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" color="#000000" style="font-size:11pt"><b>De :</b> Gate-users <gate-users-bounces@lists.opengatecollaboration.org> de la part de Christopher Watanabe <chris.r.watanabe@gmail.com><br>
<b>Envoyé :</b> 4 mars 2020 12:01<br>
<b>À :</b> gate-users@lists.opengatecollaboration.org <gate-users@lists.opengatecollaboration.org><br>
<b>Objet :</b> [Gate-users] Gate equivalent of a "pass" command</font>
<div> </div>
</div>
<div>
<div dir="ltr">
<p class="x_MsoNormal" style="margin:0in 0in 0.0001pt; font-size:11pt; font-family:"Calibri",sans-serif">
<span>Hello all, <br>
<br>
I’m assigning some commands to a Gate macro via bash scripts. In this way, within my bash script, I can declare a variable called “visCommand” that will control whether visualization is called by the Gate macro or not:
<br>
<br>
<i>within bash script ----------------------------<span></span></i></span></p>
<p class="x_MsoNormal" style="margin:0in 0in 0.0001pt; font-size:11pt; font-family:"Calibri",sans-serif">
<span><br>
if $vis ; then <span></span></span></p>
<p class="x_MsoNormal" style="margin:0in 0in 0.0001pt; font-size:11pt; font-family:"Calibri",sans-serif">
<span> visCommand=’/control/execute mac/vis.mac’ <span></span></span></p>
<p class="x_MsoNormal" style="margin:0in 0in 0.0001pt; font-size:11pt; font-family:"Calibri",sans-serif">
<span>else <span></span></span></p>
<p class="x_MsoNormal" style="margin:0in 0in 0.0001pt; font-size:11pt; font-family:"Calibri",sans-serif">
<span> visCommand=’/vis/disable’<span></span></span></p>
<p class="x_MsoNormal" style="margin:0in 0in 0.0001pt; font-size:11pt; font-family:"Calibri",sans-serif">
<span>fi <br>
---------------------------------------------------------<span></span></span></p>
<p class="x_MsoNormal" style="margin:0in 0in 0.0001pt; font-size:11pt; font-family:"Calibri",sans-serif">
<span><span> </span></span></p>
<p class="x_MsoNormal" style="margin:0in 0in 12pt; font-size:11pt; font-family:"Calibri",sans-serif">
<span>Then just calling {visCommand} in my Gate macro calls the appropriate command. This works fine for Gate commands that have enabling or disabling, but I would like to accomplish a similar task. Namely calling for a certain number of primaries per run if
a non-zero argument is given for number of primaries. However, this is not a matter of disabling anything, so I’m wondering whether Gate has the equivalent of a “pass” command.
<span></span></span></p>
<p class="x_MsoNormal" style="margin:0in 0in 0.0001pt; font-size:11pt; font-family:"Calibri",sans-serif">
<i><span>Within bash script once more ----------------------------------<span></span></span></i></p>
<p class="x_MsoNormal" style="margin:0in 0in 0.0001pt; font-size:11pt; font-family:"Calibri",sans-serif">
<i><span><span> </span></span></i></p>
<p class="x_MsoNormal" style="margin:0in 0in 0.0001pt; font-size:11pt; font-family:"Calibri",sans-serif">
<span>If [ $primaries > 0]; then <span></span></span></p>
<p class="x_MsoNormal" style="margin:0in 0in 0.0001pt; font-size:11pt; font-family:"Calibri",sans-serif">
<span> activityCommand=’/gate/application/setNumberOfPrimariesPerRun {primariesPerRun}’<span></span></span></p>
<p class="x_MsoNormal" style="margin:0in 0in 0.0001pt; font-size:11pt; font-family:"Calibri",sans-serif">
<span>else<span></span></span></p>
<p class="x_MsoNormal" style="margin:0in 0in 0.0001pt; font-size:11pt; font-family:"Calibri",sans-serif">
<span> activityCommand=<b><u>SOME GATE COMMAND THAT TELLS GATE TO DO NOTHING<span></span></u></b></span></p>
<p class="x_MsoNormal" style="margin:0in 0in 0.0001pt; font-size:11pt; font-family:"Calibri",sans-serif">
<span>fi<span></span></span></p>
<p class="x_MsoNormal" style="margin:0in 0in 0.0001pt; font-size:11pt; font-family:"Calibri",sans-serif">
<span><span> </span></span></p>
<p class="x_MsoNormal" style="margin:0in 0in 0.0001pt; font-size:11pt; font-family:"Calibri",sans-serif">
<span>If you don’t understand the bash scripting, that’s okay. In this context, I just need a Gate command that tells Gate to disregard this line in the macro. I’ve tried to just insert a comment, but GATE throws an error because it can’t find the command.
I’m not sure whether this would be a bash nuance though – perhaps something such as activityCommand=’#/this_is_a_gate_comment’ is somehow illegal.<span></span></span></p>
<p class="x_MsoNormal" style="margin:0in 0in 0.0001pt; font-size:11pt; font-family:"Calibri",sans-serif">
<span><span> </span></span></p>
<p class="x_MsoNormal" style="margin:0in 0in 0.0001pt; font-size:11pt; font-family:"Calibri",sans-serif">
<span>In any case, I appreciate any help! And if you’re curious about calling Gate from bash scripts, let me know in an email!
<br>
<br>
Best, <br>
<br>
Chris<span></span></span></p>
</div>
</div>
</body>
</html>