<?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; expression</title>
	<atom:link href="http://www.lsmod.net/tag/expression/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>
	</channel>
</rss>
