<?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: CGI Perl scripts debugging (solve 500 Internal Server Error)</title>
	<atom:link href="http://www.linuxscrew.com/2007/08/17/cgi-perl-scripts-debugging-solve-500-internal-server-error/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.linuxscrew.com/2007/08/17/cgi-perl-scripts-debugging-solve-500-internal-server-error/</link>
	<description></description>
	<lastBuildDate>Fri, 10 Feb 2012 06:51:03 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=9129</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Tom</title>
		<link>http://www.linuxscrew.com/2007/08/17/cgi-perl-scripts-debugging-solve-500-internal-server-error/comment-page-1/#comment-466150</link>
		<dc:creator>Tom</dc:creator>
		<pubDate>Wed, 20 Apr 2011 02:33:16 +0000</pubDate>
		<guid isPermaLink="false">http://linuxscrew.com/?p=47#comment-466150</guid>
		<description>i have a problem to run the script in linux. there is a mistake in the script. so cany you solve for me.........


#!/bin/bash
# Process each file and link it if it is okay.
processfile
{
  lnopts=&quot;$1&quot;
  filename=&quot;$2&quot;

  # file must be &quot;normal file&quot;
  if [ ! -f &quot;$filename&quot; ]
  then
    echo Not a normal file: $filename
    retval=1
  # must have &quot;read perms&quot;
  elif [ ! -r &quot;$filename&quot; ]
  then
    echo &quot;No read permissions: $filename&quot;
    retval=1
  # user must either effective owner the file or effective group owner of the file
  elif [ ! -O &quot;$filename&quot; -o ! -G &quot;$filename&quot; ]
  then
    echo &quot;No effective ownership or effective group ownership of file: $filename&quot;
    retval=1
  # Otherwise all is well, link the file to current directory using existing name
  else
    ln $lnopts $filename
    retval=$?
  fi
  # Return the exit status code &gt; 0 if a problem occured
  return $retval
}
# Initialise variables
cont=&#039;N&#039;
lnopts=&#039;&#039;

# Process switches
while test &quot;$1&quot; = &#039;-c&#039; &#039;-o&#039; &quot;$1&quot; = &#039;-s&#039;
do
  if [ &quot;$1&quot; = &#039;-c&#039; ]
  then
    cont=&#039;Y&#039;
    shift
  fi
  if [ &quot;$1&quot; = &#039;-s&#039; ]
  then
    lnopts=&#039;-s&#039;
    shift
  fi
done

echo &quot;Commencing generation of files

if [$# -lt 1]
  while read filename
  do
    processfile &quot;$lnopts&quot; &quot;$filename&quot;
    result=$?
    test $result -ne 0 -a &quot;$cont&quot; != &#039;Y&#039; -a &quot;$cont&quot; != &#039;y&#039; &#124;&#124; exit 1
  done
else
  for filename in $*
  do
    processfile &quot;$lnopts&quot; &quot;$filename&quot;
    result=$?
    if [ $result -ne 0 -a &quot;$cont&quot; != &#039;Y&#039; ]
    then
      echo -n &quot;Error occurred.  Continue (y/n/a)? &quot;
      read $cont
      test &quot;$cont&quot; = &#039;n&#039; -o &quot;$cont&quot; = &#039;N&#039; &amp;&amp; exit 1
      [ &quot;$cont&quot; = &#039;a&#039; &#124;&#124; &quot;$cont&quot; = &#039;A&#039; ] &amp;&amp; cont=&#039;Y&#039;
    fi
  done
fi
echo &quot;All files processed&quot;</description>
		<content:encoded><![CDATA[<p>i have a problem to run the script in linux. there is a mistake in the script. so cany you solve for me&#8230;&#8230;&#8230;</p>
<p>#!/bin/bash<br />
# Process each file and link it if it is okay.<br />
processfile<br />
{<br />
  lnopts=&#8221;$1&#8243;<br />
  filename=&#8221;$2&#8243;</p>
<p>  # file must be &#8220;normal file&#8221;<br />
  if [ ! -f "$filename" ]<br />
  then<br />
    echo Not a normal file: $filename<br />
    retval=1<br />
  # must have &#8220;read perms&#8221;<br />
  elif [ ! -r "$filename" ]<br />
  then<br />
    echo &#8220;No read permissions: $filename&#8221;<br />
    retval=1<br />
  # user must either effective owner the file or effective group owner of the file<br />
  elif [ ! -O "$filename" -o ! -G "$filename" ]<br />
  then<br />
    echo &#8220;No effective ownership or effective group ownership of file: $filename&#8221;<br />
    retval=1<br />
  # Otherwise all is well, link the file to current directory using existing name<br />
  else<br />
    ln $lnopts $filename<br />
    retval=$?<br />
  fi<br />
  # Return the exit status code &gt; 0 if a problem occured<br />
  return $retval<br />
}<br />
# Initialise variables<br />
cont=&#8217;N&#8217;<br />
lnopts=&#8221;</p>
<p># Process switches<br />
while test &#8220;$1&#8243; = &#8216;-c&#8217; &#8216;-o&#8217; &#8220;$1&#8243; = &#8216;-s&#8217;<br />
do<br />
  if [ "$1" = '-c' ]<br />
  then<br />
    cont=&#8217;Y&#8217;<br />
    shift<br />
  fi<br />
  if [ "$1" = '-s' ]<br />
  then<br />
    lnopts=&#8217;-s&#8217;<br />
    shift<br />
  fi<br />
done</p>
<p>echo &#8220;Commencing generation of files</p>
<p>if [$# -lt 1]<br />
  while read filename<br />
  do<br />
    processfile &#8220;$lnopts&#8221; &#8220;$filename&#8221;<br />
    result=$?<br />
    test $result -ne 0 -a &#8220;$cont&#8221; != &#8216;Y&#8217; -a &#8220;$cont&#8221; != &#8216;y&#8217; || exit 1<br />
  done<br />
else<br />
  for filename in $*<br />
  do<br />
    processfile &#8220;$lnopts&#8221; &#8220;$filename&#8221;<br />
    result=$?<br />
    if [ $result -ne 0 -a "$cont" != 'Y' ]<br />
    then<br />
      echo -n &#8220;Error occurred.  Continue (y/n/a)? &#8221;<br />
      read $cont<br />
      test &#8220;$cont&#8221; = &#8216;n&#8217; -o &#8220;$cont&#8221; = &#8216;N&#8217; &amp;&amp; exit 1<br />
      [ "$cont" = 'a' || "$cont" = 'A' ] &amp;&amp; cont=&#8217;Y&#8217;<br />
    fi<br />
  done<br />
fi<br />
echo &#8220;All files processed&#8221;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dion</title>
		<link>http://www.linuxscrew.com/2007/08/17/cgi-perl-scripts-debugging-solve-500-internal-server-error/comment-page-1/#comment-34872</link>
		<dc:creator>Dion</dc:creator>
		<pubDate>Tue, 09 Jun 2009 05:22:32 +0000</pubDate>
		<guid isPermaLink="false">http://linuxscrew.com/?p=47#comment-34872</guid>
		<description>Thanks :-)</description>
		<content:encoded><![CDATA[<p>Thanks <img src='http://www.linuxscrew.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
</channel>
</rss>

