<?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>ITSA Blog &#187; Tip of the day!</title>
	<atom:link href="http://itsecureadmin.com/category/totd/feed/" rel="self" type="application/rss+xml" />
	<link>http://itsecureadmin.com</link>
	<description>Life as an Open Source Solutions Architect.</description>
	<lastBuildDate>Wed, 01 Sep 2010 18:23:22 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Bash Tip!  for loop on directory listing</title>
		<link>http://itsecureadmin.com/2010/08/bash-tip-for-loop-on-directory-listing/</link>
		<comments>http://itsecureadmin.com/2010/08/bash-tip-for-loop-on-directory-listing/#comments</comments>
		<pubDate>Tue, 24 Aug 2010 17:52:43 +0000</pubDate>
		<dc:creator>Josh Miller, Red Hat Certified Engineer</dc:creator>
				<category><![CDATA[Open Source Software]]></category>
		<category><![CDATA[Tip of the day!]]></category>

		<guid isPermaLink="false">http://itsecureadmin.com/?p=105</guid>
		<description><![CDATA[One very common task when scripting with bash is to use a for loop to iterate over the contents of a directory or directory tree.  There are two primary methods of accomplishing this task; using ls and using find.  We&#8217;ll not consider the manual method as that would be completely unworthy of our [...]]]></description>
			<content:encoded><![CDATA[<p>One very common task when scripting with bash is to use a for loop to iterate over the contents of a directory or directory tree.  There are two primary methods of accomplishing this task; using <code>ls</code> and using <code>find</code>.  We&#8217;ll not consider the manual method as that would be completely unworthy of our attention.</p>
<p>I find it easy to start with <code>ls</code> when I don&#8217;t need to recurse into a directory tree as that is a command that I use often.  This often turns into a process such as this:</p>
<pre>
for dir in $(ls)
do
  echo ${dir}
done
</pre>
<p>Now the above method typically does not work for me.  I have an alias setup to print out pretty colors when I issue the <code>ls</code> command and that will cause each command which operates on the variable <code>$dir</code> to fail with a &#8220;No such file or directory&#8221; error.  I always have to remember this and re-write the command with the flag to disable color formatting:</p>
<pre>
for dir in $(ls --color=never)
do
  echo ${dir}
done
</pre>
<p>The above script will work every time.</p>
<p>The next option is using <code>find</code>.  <code>find</code> is awesome and all powerful.  Learn and use <code>find</code>.  The most common issue when using find is that you may have to filter out the current and/or parent directories when processing the results.  Take this example:</p>
<pre>
for dir in $(find . -maxdepth 1 -type d)
do
  echo ${dir}
done
</pre>
<p>This loop will print out the current directory, as well as all other directories in the current working directory.  If you are running some sort of processing within this loop, you may end up re-processing everything unless you discard the current working directory (noted by the dot).</p>
<p>This example will not process the current working directory:</p>
<pre>
for dir in $(find . -maxdepth 1 -type d)
do
  if [ ${dir} == "." ]
  then
    continue
  fi
  echo ${dir}
  while pushd ${dir}
  do
    echo ${dir}
  done
  popd
done
</pre>
<p>Bash for loops are incredibly useful and easy to work with.  Use the above tips and make bash work for you.</p>
]]></content:encoded>
			<wfw:commentRss>http://itsecureadmin.com/2010/08/bash-tip-for-loop-on-directory-listing/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>System Administrator Technical Interviews</title>
		<link>http://itsecureadmin.com/2010/07/system-administrator-technical-interviews/</link>
		<comments>http://itsecureadmin.com/2010/07/system-administrator-technical-interviews/#comments</comments>
		<pubDate>Thu, 08 Jul 2010 16:26:46 +0000</pubDate>
		<dc:creator>Josh Miller, Red Hat Certified Engineer</dc:creator>
				<category><![CDATA[Open Source Software]]></category>
		<category><![CDATA[Tip of the day!]]></category>
		<category><![CDATA[interviews]]></category>
		<category><![CDATA[jobs]]></category>
		<category><![CDATA[tips]]></category>

		<guid isPermaLink="false">http://itsecureadmin.com/2010/07/system-administrator-technical-interviews/</guid>
		<description><![CDATA[I have had the opportunity to interview many candidates over the past few months and have a few tips:

When indicating that you have VMware experience, clearly indicate which features you have experience with.  I have interviewed many candidates who claim to be experts on VI3/vSphere and yet have never used clustering or shared storage.
When [...]]]></description>
			<content:encoded><![CDATA[<p>I have had the opportunity to interview many candidates over the past few months and have a few tips:</p>
<ul>
<li>When indicating that you have VMware experience, clearly indicate which features you have experience with.  I have interviewed many candidates who claim to be experts on VI3/vSphere and yet have never used clustering or shared storage.</li>
<li>When asked about rating yourself from 1-5 or 1-10, make sure you understand which side is the proficient side and give an example of what you think is proficient in a particular area.</li>
</ul>
<p>My methodology is to ask the interviewee to rate themselves and then ask them what that rating means to them.  If they rate themselves a 4 out of 5 with general Linux system administration, I then ask them to give me a few examples of what somebody who has a 4/5 rating would be able to do.  I then ask them questions based on that assessment.  If you can&#8217;t win on those terms, you typically can&#8217;t win.</p>
<p>It is not my desire to stump somebody in an interview, I would prefer to ask them questions about what they have done in the past and get into a good dialogue about things they are familiar with.  Do your interviewer a favor and be very clear on the resume and during the interview process.</p>
]]></content:encoded>
			<wfw:commentRss>http://itsecureadmin.com/2010/07/system-administrator-technical-interviews/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Bash Tip!  Renaming files using Bash string operations</title>
		<link>http://itsecureadmin.com/2010/01/bash-tip-renaming-files-using-bash-string-operations/</link>
		<comments>http://itsecureadmin.com/2010/01/bash-tip-renaming-files-using-bash-string-operations/#comments</comments>
		<pubDate>Thu, 07 Jan 2010 05:47:47 +0000</pubDate>
		<dc:creator>Josh Miller, Red Hat Certified Engineer</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Open Source Software]]></category>
		<category><![CDATA[Tip of the day!]]></category>

		<guid isPermaLink="false">http://itsecureadmin.com/blog/?p=44</guid>
		<description><![CDATA[To rename all html files in a particular directory to shtml files, use the following loop:
for file in *.html
do
  mv ${file} ${file%%.html}.shtml
done
This uses the ${variable%%match} format which strips the longest match from the end of the variable.
]]></description>
			<content:encoded><![CDATA[<p>To rename all html files in a particular directory to shtml files, use the following loop:</p>
<pre>for file in *.html
do
  mv ${file} ${file%%.html}.shtml
done</pre>
<p>This uses the ${variable%%match} format which strips the longest match from the end of the variable.</p>
]]></content:encoded>
			<wfw:commentRss>http://itsecureadmin.com/2010/01/bash-tip-renaming-files-using-bash-string-operations/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
