<?xml version="1.0" encoding="UTF-8"?><rss
version="2.0"
xmlns:content="http://purl.org/rss/1.0/modules/content/"
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/"
> <channel><title>Comments on: Linux / UNIX: Find Out If a Directory Exists or Not</title> <atom:link href="http://www.cyberciti.biz/tips/find-out-if-directory-exists.html/feed" rel="self" type="application/rss+xml" /><link>http://www.cyberciti.biz/tips/find-out-if-directory-exists.html</link> <description>This is a Linux sys admin journal by Vivek about sys admin work, Linux tips &#38; tricks, hacks, news and more.</description> <lastBuildDate>Fri, 10 Feb 2012 20:37:43 +0000</lastBuildDate> <sy:updatePeriod>hourly</sy:updatePeriod> <sy:updateFrequency>1</sy:updateFrequency> <generator>http://wordpress.org/?v=3.3.1</generator> <item><title>By: vignesh</title><link>http://www.cyberciti.biz/tips/find-out-if-directory-exists.html#comment-177015</link> <dc:creator>vignesh</dc:creator> <pubDate>Wed, 14 Dec 2011 13:15:09 +0000</pubDate> <guid
isPermaLink="false">http://www.cyberciti.biz/tips/?p=3560#comment-177015</guid> <description>i need to print the file names of all files having .txt extension of a given directory after converting to uppercase letters. The input (directory name) should be given as command line argument. The script will also check whether sufficient arguments are passed or not and whether the argument is a directory or not
i tried using this code
if [ -f $filename ]
tr &quot;[a-z]&quot; &quot;[A-Z]&quot; &lt;$filename
but i dint get output</description> <content:encoded><![CDATA[<p>i need to print the file names of all files having .txt extension of a given directory after converting to uppercase letters. The input (directory name) should be given as command line argument. The script will also check whether sufficient arguments are passed or not and whether the argument is a directory or not</p><p>i tried using this code</p><p>if [ -f $filename ]<br
/> tr &#8220;[a-z]&#8221; &#8220;[A-Z]&#8221; &lt;$filename</p><p>but i dint get output</p> ]]></content:encoded> </item> <item><title>By: Vamsi</title><link>http://www.cyberciti.biz/tips/find-out-if-directory-exists.html#comment-160453</link> <dc:creator>Vamsi</dc:creator> <pubDate>Wed, 27 Oct 2010 09:11:10 +0000</pubDate> <guid
isPermaLink="false">http://www.cyberciti.biz/tips/?p=3560#comment-160453</guid> <description>u can use test -f  to check whether filename exists or not
u can use test -d  to check whether directoryname exists or not
Returns &quot;zero&quot; if exists and &quot;one&quot; if doesn&#039;t exist.</description> <content:encoded><![CDATA[<p>u can use test -f  to check whether filename exists or not<br
/> u can use test -d  to check whether directoryname exists or not</p><p>Returns &#8220;zero&#8221; if exists and &#8220;one&#8221; if doesn&#8217;t exist.</p> ]]></content:encoded> </item> <item><title>By: aneesh</title><link>http://www.cyberciti.biz/tips/find-out-if-directory-exists.html#comment-145609</link> <dc:creator>aneesh</dc:creator> <pubDate>Tue, 18 Nov 2008 05:29:47 +0000</pubDate> <guid
isPermaLink="false">http://www.cyberciti.biz/tips/?p=3560#comment-145609</guid> <description>Dear Friends,
We can do the same thing to check a file exist or not by modifying the &quot;if&quot; loop like the following.
!/bin/bash
FILE=&quot;$1&quot;
if [ $# -ne 1 ]
then
echo &quot;Usage: $0 {file-name}&quot;
exit 1
fi
if [ -f &quot;$FILE&quot; ]
then
echo &quot;$FILE file  exists!&quot;
else
echo &quot;$FILE file not found!&quot;
fi</description> <content:encoded><![CDATA[<p>Dear Friends,</p><p> We can do the same thing to check a file exist or not by modifying the &#8220;if&#8221; loop like the following.</p><p>!/bin/bash<br
/> FILE=&#8221;$1&#8243;</p><p>if [ $# -ne 1 ]<br
/> then<br
/> echo &#8220;Usage: $0 {file-name}&#8221;<br
/> exit 1<br
/> fi</p><p>if [ -f "$FILE" ]<br
/> then<br
/> echo &#8220;$FILE file  exists!&#8221;<br
/> else<br
/> echo &#8220;$FILE file not found!&#8221;<br
/> fi</p> ]]></content:encoded> </item> </channel> </rss>
