<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[How to execute bash script on a mac]]></title><description><![CDATA[<p dir="auto">Hi,</p>
<p dir="auto">I have tried many things, but I am not able to run a simple bash script on my mac</p>
<pre><code>#!/bin/bash
chrome-cli open https://github.com/prasmussen/chrome-cli
</code></pre>
<p dir="auto"><img src="/forum/assets/uploads/files/1631998659814-b5dd8ad6-4779-4110-a8b7-f259fe0d010a-image.png" alt="b5dd8ad6-4779-4110-a8b7-f259fe0d010a-image.png" class=" img-fluid img-markdown" /></p>
<p dir="auto">I want to use chrome-cli to automate chrome from my google home device. Obviously the bash script works fine when executed in the console.</p>
<p dir="auto">Thanks in advance.</p>
]]></description><link>https://www.triggercmd.com/forum/topic/1620/how-to-execute-bash-script-on-a-mac</link><generator>RSS for Node</generator><lastBuildDate>Sun, 10 May 2026 16:54:05 GMT</lastBuildDate><atom:link href="https://www.triggercmd.com/forum/topic/1620.rss" rel="self" type="application/rss+xml"/><pubDate>Sat, 18 Sep 2021 20:59:07 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to How to execute bash script on a mac on Wed, 22 Sep 2021 00:02:09 GMT]]></title><description><![CDATA[<p dir="auto"><a class="mention plugin-mentions-user plugin-mentions-a" href="https://www.triggercmd.com/forum/uid/2375">@Johnny-Bx</a> , nice. Glad that worked.</p>
]]></description><link>https://www.triggercmd.com/forum/post/4605</link><guid isPermaLink="true">https://www.triggercmd.com/forum/post/4605</guid><dc:creator><![CDATA[Russ]]></dc:creator><pubDate>Wed, 22 Sep 2021 00:02:09 GMT</pubDate></item><item><title><![CDATA[Reply to How to execute bash script on a mac on Tue, 21 Sep 2021 10:05:15 GMT]]></title><description><![CDATA[<p dir="auto">Thanks!<br />
chrome-cli is installed into another directory on my laptop (/opt/homebrew/bin/) but by calling "/opt/homebrew/bin/chrome-cli open <a href="https://github.com/prasmussen/chrome-cli" rel="nofollow ugc">https://github.com/prasmussen/chrome-cli</a>" it worked fine.</p>
]]></description><link>https://www.triggercmd.com/forum/post/4601</link><guid isPermaLink="true">https://www.triggercmd.com/forum/post/4601</guid><dc:creator><![CDATA[Johnny Bx]]></dc:creator><pubDate>Tue, 21 Sep 2021 10:05:15 GMT</pubDate></item><item><title><![CDATA[Reply to How to execute bash script on a mac on Tue, 21 Sep 2021 00:17:39 GMT]]></title><description><![CDATA[<p dir="auto"><a class="mention plugin-mentions-user plugin-mentions-a" href="https://www.triggercmd.com/forum/uid/2375">@Johnny-Bx</a>, just in case it's not finding the path to your chrome-cli tool, please try specifying the full path like this:</p>
<pre><code>#!/bin/bash
/usr/local/bin/chrome-cli open https://google.com/search?q=$1
</code></pre>
<p dir="auto">This worked for me too though, so I don't know why it didn't work for you:</p>
<pre><code>#!/bin/bash
chrome-cli open https://google.com/search?q=$1
</code></pre>
]]></description><link>https://www.triggercmd.com/forum/post/4557</link><guid isPermaLink="true">https://www.triggercmd.com/forum/post/4557</guid><dc:creator><![CDATA[Russ]]></dc:creator><pubDate>Tue, 21 Sep 2021 00:17:39 GMT</pubDate></item><item><title><![CDATA[Reply to How to execute bash script on a mac on Mon, 20 Sep 2021 15:43:45 GMT]]></title><description><![CDATA[<p dir="auto"><a class="mention plugin-mentions-user plugin-mentions-a" href="https://www.triggercmd.com/forum/uid/1">@Russ</a> said in <a href="/forum/post/4545">How to execute bash script on a mac</a>:</p>
<blockquote>
<p dir="auto">echo "It ran" &gt;&gt; /tmp/run.log</p>
</blockquote>
<p dir="auto">Hi,<br />
I see "It ran" into run.log</p>
<p dir="auto">Looks like the script is executed but for some reasion chrome-cli is not evaluated...</p>
<p dir="auto">Thanks</p>
]]></description><link>https://www.triggercmd.com/forum/post/4554</link><guid isPermaLink="true">https://www.triggercmd.com/forum/post/4554</guid><dc:creator><![CDATA[Johnny Bx]]></dc:creator><pubDate>Mon, 20 Sep 2021 15:43:45 GMT</pubDate></item><item><title><![CDATA[Reply to How to execute bash script on a mac on Mon, 20 Sep 2021 02:24:27 GMT]]></title><description><![CDATA[<p dir="auto"><a class="mention plugin-mentions-user plugin-mentions-a" href="https://www.triggercmd.com/forum/uid/2375">@Johnny-Bx</a>, you could try adding a line like this to your script:</p>
<pre><code>#!/bin/bash
echo "It ran" &gt;&gt; /tmp/run.log
chrome-cli open https://github.com/prasmussen/chrome-cli
</code></pre>
<p dir="auto">If you see something in /tmp/run.log you'll know it at least ran the script.</p>
]]></description><link>https://www.triggercmd.com/forum/post/4545</link><guid isPermaLink="true">https://www.triggercmd.com/forum/post/4545</guid><dc:creator><![CDATA[Russ]]></dc:creator><pubDate>Mon, 20 Sep 2021 02:24:27 GMT</pubDate></item><item><title><![CDATA[Reply to How to execute bash script on a mac on Sun, 19 Sep 2021 16:58:54 GMT]]></title><description><![CDATA[<p dir="auto"><a class="mention plugin-mentions-user plugin-mentions-a" href="https://www.triggercmd.com/forum/uid/1">@Russ</a> said in <a href="/forum/post/4540">How to execute bash script on a mac</a>:</p>
<blockquote>
<p dir="auto">~)</p>
</blockquote>
<p dir="auto">Hi,</p>
<p dir="auto">Yes you are right ./ means current directory but I have tried the full path, a tilde + the rest of the directory and even into a directory visible by the PATH but nothing happens when I click on the execute button. Other commands works fine (ie open -a Calculator) but not this one. I will make more investigations and thanks for you input.</p>
]]></description><link>https://www.triggercmd.com/forum/post/4542</link><guid isPermaLink="true">https://www.triggercmd.com/forum/post/4542</guid><dc:creator><![CDATA[Johnny Bx]]></dc:creator><pubDate>Sun, 19 Sep 2021 16:58:54 GMT</pubDate></item><item><title><![CDATA[Reply to How to execute bash script on a mac on Sat, 18 Sep 2021 21:44:37 GMT]]></title><description><![CDATA[<p dir="auto"><a class="mention plugin-mentions-user plugin-mentions-a" href="https://www.triggercmd.com/forum/uid/2375">@Johnny-Bx</a>, I suspect it's not finding the script because the path to it is wrong.</p>
<p dir="auto">The dot (.) in ./script1.sh means run <a href="http://script.sh" rel="nofollow ugc">script.sh</a> in the current directly.  If <a href="http://script1.sh" rel="nofollow ugc">script1.sh</a> is in your home directory, you could replace the dot with a ~.  The tilde (~) is a reference to your home directory.</p>
<p dir="auto">Alternatively, you could specify the full path, like /scripts/script1.sh in that TRIGGERcmd Command field.</p>
<p dir="auto">A third option would be to put <a href="http://script1.sh" rel="nofollow ugc">script1.sh</a> in a folder that your PATH environment variable includes, and make your command just <a href="http://script1.sh" rel="nofollow ugc">script1.sh</a> instead of ./script.sh.</p>
<p dir="auto">I hope that helps.  Let me know please.</p>
]]></description><link>https://www.triggercmd.com/forum/post/4540</link><guid isPermaLink="true">https://www.triggercmd.com/forum/post/4540</guid><dc:creator><![CDATA[Russ]]></dc:creator><pubDate>Sat, 18 Sep 2021 21:44:37 GMT</pubDate></item></channel></rss>