<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>/sbin/lsmod - Módulos para seu cérebro &#187; shell script</title>
	<atom:link href="http://www.lsmod.net/tag/shell-script/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.lsmod.net</link>
	<description>Módulos para seu cérebro</description>
	<lastBuildDate>Wed, 28 Jul 2010 03:34:11 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Using conditional expressions to improve your shell scripts</title>
		<link>http://www.lsmod.net/2009/11/conditional-expressions-shell-script/</link>
		<comments>http://www.lsmod.net/2009/11/conditional-expressions-shell-script/#comments</comments>
		<pubDate>Tue, 24 Nov 2009 02:56:51 +0000</pubDate>
		<dc:creator>Jeremias Zerbini</dc:creator>
				<category><![CDATA[Posix]]></category>
		<category><![CDATA[Programação]]></category>
		<category><![CDATA[condicional]]></category>
		<category><![CDATA[conditional]]></category>
		<category><![CDATA[expressão]]></category>
		<category><![CDATA[expression]]></category>
		<category><![CDATA[expressions]]></category>
		<category><![CDATA[expressões]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[opensource]]></category>
		<category><![CDATA[script]]></category>
		<category><![CDATA[shell]]></category>
		<category><![CDATA[shell script]]></category>

		<guid isPermaLink="false">http://www.lsmod.net/?p=274</guid>
		<description><![CDATA[You can use these very simple shell script conditional expressions to improve your home-made scripts, making them more efficient and easy to mantain. To check if a file exists and it&#8217;s executable, use: #!/bin/bash FILE=/usr/bin/passwd if [ -x $FILE ]; then echo &#34;File $FILE exists and it is executable&#34; else echo &#34;File $FILE does not [...]


Leia também:<ol><li><a href='http://www.lsmod.net/2008/09/teste-mod-syntax-highlighting/' rel='bookmark' title='Permanent Link: Teste: Mod Syntax Highlighting'>Teste: Mod Syntax Highlighting</a> <small>Encontrei este mod e passarei a usá-lo de agora em...</small></li>
<li><a href='http://www.lsmod.net/2009/09/como-remover-apenas-um-grupo-de-usuario-no-unix/' rel='bookmark' title='Permanent Link: Como remover apenas um grupo de usuário no Unix'>Como remover apenas um grupo de usuário no Unix</a> <small>Olá pessoal ! Ontem foi dia de análise de alguns...</small></li>
<li><a href='http://www.lsmod.net/2010/06/faca-seu-cron-calar-a-boca-e-deixar-de-entupir-sua-mailbox/' rel='bookmark' title='Permanent Link: Faça seu cron calar a boca (e deixar de entupir sua mailbox)'>Faça seu cron calar a boca (e deixar de entupir sua mailbox)</a> <small>Se você também se irrita com os trilhões de emails...</small></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>You can use these very simple shell script conditional expressions to improve your home-made scripts, making them more efficient and easy to mantain.</p>
<p>To check if a file exists and it&#8217;s executable, use:</p>
<pre class="brush: bash;">#!/bin/bash
FILE=/usr/bin/passwd

if [ -x $FILE ];
then
 echo &quot;File $FILE exists and it is executable&quot;
else
 echo &quot;File $FILE does not exists or it isnt executable&quot;
fi</pre>
<p>There are several other options. Here&#8217;s the full available conditional expressions: <span style="color: #ff0000;"><strong></strong></span></p>
<p><span style="color: #ff0000;"><strong>-e</strong></span>: Returns true value if file exists<span style="color: #ff0000;"><strong><br />
-f</strong></span>: Return true value if file exists and regular file<br />
<strong><span style="color: #ff0000;">-r</span></strong>: Return true value if file exists and is readable<br />
<span style="color: #ff0000;"><strong>-w</strong></span>: Return true value if file exists and is writable<br />
<span style="color: #ff0000;"><strong>-x</strong></span>: Return true value if file exists and is executable<br />
<span style="color: #ff0000;"><strong>-d</strong></span>: Return true value if exists and is a directory</p>
<p>Have fun improving your scripts !</p>
<img src="http://www.lsmod.net/?ak_action=api_record_view&id=274&type=feed" alt="" />

<p>Leia também:<ol><li><a href='http://www.lsmod.net/2008/09/teste-mod-syntax-highlighting/' rel='bookmark' title='Permanent Link: Teste: Mod Syntax Highlighting'>Teste: Mod Syntax Highlighting</a> <small>Encontrei este mod e passarei a usá-lo de agora em...</small></li>
<li><a href='http://www.lsmod.net/2009/09/como-remover-apenas-um-grupo-de-usuario-no-unix/' rel='bookmark' title='Permanent Link: Como remover apenas um grupo de usuário no Unix'>Como remover apenas um grupo de usuário no Unix</a> <small>Olá pessoal ! Ontem foi dia de análise de alguns...</small></li>
<li><a href='http://www.lsmod.net/2010/06/faca-seu-cron-calar-a-boca-e-deixar-de-entupir-sua-mailbox/' rel='bookmark' title='Permanent Link: Faça seu cron calar a boca (e deixar de entupir sua mailbox)'>Faça seu cron calar a boca (e deixar de entupir sua mailbox)</a> <small>Se você também se irrita com os trilhões de emails...</small></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.lsmod.net/2009/11/conditional-expressions-shell-script/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Teste: Mod Syntax Highlighting</title>
		<link>http://www.lsmod.net/2008/09/teste-mod-syntax-highlighting/</link>
		<comments>http://www.lsmod.net/2008/09/teste-mod-syntax-highlighting/#comments</comments>
		<pubDate>Tue, 23 Sep 2008 04:16:43 +0000</pubDate>
		<dc:creator>Jeremias Zerbini</dc:creator>
				<category><![CDATA[Programação]]></category>
		<category><![CDATA[bash]]></category>
		<category><![CDATA[delphi]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[shell script]]></category>
		<category><![CDATA[syntax]]></category>
		<category><![CDATA[syntax highlighting]]></category>
		<category><![CDATA[teste]]></category>

		<guid isPermaLink="false">http://www.lsmod.net/?p=94</guid>
		<description><![CDATA[Encontrei este mod e passarei a usá-lo de agora em diante. Quem quiser ter um igual é só instalar este mod aqui. ?View Code JAVA1 2 3 4 5 public class Hello &#123; public static void main&#40;String&#91;&#93; args&#41; &#123; System.out.println&#40;&#34;Olá mundo!&#34;&#41;; &#125; &#125; ?View Code BASH1 2 3 4 #!/bin/bash FILE=/etc/file echo $FILE echo &#34;string&#34; [...]


Leia também:<ol><li><a href='http://www.lsmod.net/2009/11/conditional-expressions-shell-script/' rel='bookmark' title='Permanent Link: Using conditional expressions to improve your shell scripts'>Using conditional expressions to improve your shell scripts</a> <small>You can use these very simple shell script conditional expressions...</small></li>
<li><a href='http://www.lsmod.net/2009/06/dia-de-grandes-atualizacoes-firefox-php-e-virtualbox/' rel='bookmark' title='Permanent Link: Dia de grandes atualizações &#8211; Firefox, PHP e VirtualBox'>Dia de grandes atualizações &#8211; Firefox, PHP e VirtualBox</a> <small>Hoje foi um dia repleto de boas notícias para o...</small></li>
<li><a href='http://www.lsmod.net/2008/09/yet-another-security-guide/' rel='bookmark' title='Permanent Link: YASG (Yet Another Security Guide)'>YASG (Yet Another Security Guide)</a> <small>A importância da segurança da informação Tratar da segurança de...</small></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>Encontrei este mod e passarei a usá-lo de agora em diante.<br />
Quem quiser ter um igual é só instalar <a href=http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/>este mod aqui</a>.</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p94code17'); return false;">View Code</a> JAVA</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p9417"><td class="line_numbers"><pre>1
2
3
4
5
</pre></td><td class="code" id="p94code17"><pre class="java" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">class</span> Hello <span style="color: #009900;">&#123;</span>
  <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">static</span> <span style="color: #000066; font-weight: bold;">void</span> main<span style="color: #009900;">&#40;</span><a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Astring+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">String</span></a><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span> args<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Asystem+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">System</span></a>.<span style="color: #006633;">out</span>.<span style="color: #006633;">println</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Olá mundo!&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>


<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p94code18'); return false;">View Code</a> BASH</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p9418"><td class="line_numbers"><pre>1
2
3
4
</pre></td><td class="code" id="p94code18"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#!/bin/bash</span>
<span style="color: #007800;">FILE</span>=<span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span><span style="color: #c20cb9; font-weight: bold;">file</span>
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #007800;">$FILE</span>
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;string&quot;</span></pre></td></tr></table></div>


<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p94code19'); return false;">View Code</a> PHP</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p9419"><td class="code" id="p94code19"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
  <span style="color: #000000; font-weight: bold;">function</span> foo<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    <span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot;Olá mundo!<span style="color: #000099; font-weight: bold;">\\</span>n&quot;</span><span style="color: #339933;">;</span>
  <span style="color: #009900;">&#125;</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></td></tr></table></div>


<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p94code20'); return false;">View Code</a> DELPHI</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p9420"><td class="code" id="p94code20"><pre class="delphi" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">begin</span>
   <span style="color: #000000; font-weight: bold;">function</span> teste
   showmessage<span style="color: #000066;">&#40;</span><span style="color: #ff0000;">'Testandoo'</span><span style="color: #000066;">&#41;</span><span style="color: #000066;">;</span>
<span style="color: #000000; font-weight: bold;">end</span><span style="color: #000066;">;</span></pre></td></tr></table></div>

<img src="http://www.lsmod.net/?ak_action=api_record_view&id=94&type=feed" alt="" />

<p>Leia também:<ol><li><a href='http://www.lsmod.net/2009/11/conditional-expressions-shell-script/' rel='bookmark' title='Permanent Link: Using conditional expressions to improve your shell scripts'>Using conditional expressions to improve your shell scripts</a> <small>You can use these very simple shell script conditional expressions...</small></li>
<li><a href='http://www.lsmod.net/2009/06/dia-de-grandes-atualizacoes-firefox-php-e-virtualbox/' rel='bookmark' title='Permanent Link: Dia de grandes atualizações &#8211; Firefox, PHP e VirtualBox'>Dia de grandes atualizações &#8211; Firefox, PHP e VirtualBox</a> <small>Hoje foi um dia repleto de boas notícias para o...</small></li>
<li><a href='http://www.lsmod.net/2008/09/yet-another-security-guide/' rel='bookmark' title='Permanent Link: YASG (Yet Another Security Guide)'>YASG (Yet Another Security Guide)</a> <small>A importância da segurança da informação Tratar da segurança de...</small></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.lsmod.net/2008/09/teste-mod-syntax-highlighting/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
