snipt

Ctrl+h for KB shortcuts
Sign up for Snipt!
Post public snipts for free. Private snipts just $5/mo.
#139576

Bash

Mac OSX Environment Variable For GUI apps

1
2
3
# To set ENV variables for GUI apps, use `launchctl setenv`
export YOUR_VAR="Hello World!"
launchctl setenv YOUR_VAR $YOUR_VAR
https://snipt.net/embed/473e39fae887f52ae1ac675720b86b8f/
https://snipt.net/raw/473e39fae887f52ae1ac675720b86b8f/
473e39fae887f52ae1ac675720b86b8f
bash
Bash
4
2015-08-27T04:51:10
True
False
May 24, 2015 at 07:25 AM
/api/public/snipt/139576/
mac-osx-environment-variable-for-gui-apps-7347322b
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a> <a href="#L-2">2</a> <a href="#L-3">3</a></pre></div></td><td class="code"><div class="highlight"><pre><span id="L-1"><a name="L-1"></a><span class="c"># To set ENV variables for GUI apps, use `launchctl setenv`</span> </span><span id="L-2"><a name="L-2"></a><span class="nb">export </span><span class="nv">YOUR_VAR</span><span class="o">=</span><span class="s2">&quot;Hello World!&quot;</span> </span><span id="L-3"><a name="L-3"></a>launchctl setenv YOUR_VAR <span class="nv">$YOUR_VAR</span> </span></pre></div> </td></tr></table>
env, osx, shell
#83044

Text only

Oracle - Shell

1
2
3
#I came up with a situation where i need to append @ and PATH at th starting of the all files that are modified on particular day here what i did

ls -lt|grep "Sep 24" | awk '{print $9}'|sed 's/^/@\/Users\/chakri\/projects\//g'
https://snipt.net/embed/202975296bec91de33b644019acb13a3/
https://snipt.net/raw/202975296bec91de33b644019acb13a3/
202975296bec91de33b644019acb13a3
text
Text only
3
2015-08-27T22:08:29
True
False
/api/public/snipt/83044/
oracle-shell
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a> <a href="#L-2">2</a> <a href="#L-3">3</a></pre></div></td><td class="code"><div class="highlight"><pre><span id="L-1"><a name="L-1"></a>#I came up with a situation where i need to append @ and PATH at th starting of the all files that are modified on particular day here what i did </span><span id="L-2"><a name="L-2"></a> </span><span id="L-3"><a name="L-3"></a>ls -lt|grep &quot;Sep 24&quot; | awk &#39;{print $9}&#39;|sed &#39;s/^/@\/Users\/chakri\/projects\//g&#39; </span></pre></div> </td></tr></table>
bash, oracle, shell
#68603

Bash

svn update with no interaction and accept certificate from cli

svn up --username <user> --password <psw> --non-interactive --trust-server-cert
https://snipt.net/embed/8ee9a30e7f44092e596ab7820a8c1502/
https://snipt.net/raw/8ee9a30e7f44092e596ab7820a8c1502/
8ee9a30e7f44092e596ab7820a8c1502
bash
Bash
1
2015-08-30T02:32:10
True
False
Jul 19, 2013 at 09:24 AM
/api/public/snipt/68603/
svn-update-with-no-interaction-and-accept-certificate-from-cli
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a></pre></div></td><td class="code"><div class="highlight"><pre><span id="L-1"><a name="L-1"></a>svn up --username &lt;user&gt; --password &lt;psw&gt; --non-interactive --trust-server-cert </span></pre></div> </td></tr></table>
accept, certificate, cli, command, line, linux, shell, svn, up, update
#67180

Shell Session

Emoticon approval on Linux prompt

   PS1="\`if [ \$? = 0 ]; then echo -e '\[\e[01;32m\]:) '; else echo -e '\[\e[01;31m\]:( '; fi\`\[\e[m\]"
https://snipt.net/embed/bfdf196422206fd3d2788f1c915404fa/
https://snipt.net/raw/bfdf196422206fd3d2788f1c915404fa/
bfdf196422206fd3d2788f1c915404fa
shell-session
Shell Session
1
2015-08-31T13:42:22
True
False
/api/public/snipt/67180/
emoticon-approval-on-linux-prompt
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a></pre></div></td><td class="code"><div class="highlight"><pre><span id="L-1"><a name="L-1"></a><span class="go"> PS1=&quot;\`if [ \$? = 0 ]; then echo -e &#39;\[\e[01;32m\]:) &#39;; else echo -e &#39;\[\e[01;31m\]:( &#39;; fi\`\[\e[m\]&quot;</span> </span></pre></div> </td></tr></table>
linux, prompt, shell
Copyrighted, illegal, or inappropriate content? Email nick@snipt.net.