<font size="2"><font face="trebuchet ms,sans-serif"><div><font size="2"><font class="Apple-style-span" face="'courier new', monospace"><br></font></font></div><div><font size="2"><font class="Apple-style-span" face="'courier new', monospace"><br>

</font></font></div><div><font size="2"><font class="Apple-style-span" face="tahoma, sans-serif">I'm trying to write a bash script to find all files that are not being owned by a user or group:</font></font></div><div>

<font size="2"><div><font class="Apple-style-span" face="'courier new', monospace">find / -path '.gvfs' -prune -o -path '/proc' -prune -o -nouser -o -nogroup -print</font></div><div><font class="Apple-style-span" face="'courier new', monospace">if [ $? -eq 0 ]</font></div>

<div><font class="Apple-style-span" face="'courier new', monospace">then</font></div><div><font class="Apple-style-span" face="'courier new', monospace">exit $STATE_OK</font></div><div><font class="Apple-style-span" face="'courier new', monospace">else</font></div>

<div><font class="Apple-style-span" face="'courier new', monospace">echo "Files with no owner or group found"</font></div><div><font class="Apple-style-span" face="'courier new', monospace">exit $STATE_CRITICAL</font></div>

<div><font class="Apple-style-span" face="'courier new', monospace">fi</font></div><div><font class="Apple-style-span" face="'courier new', monospace"><br></font></div></font></div><div><font size="2"><font class="Apple-style-span" face="tahoma, sans-serif">The script basically works except it stumbles on a directory created by the gnome virtual filesystem daemon called .gvfs. The results are:</font></font></div>

<div><font size="2"><font class="Apple-style-span" face="'courier new', monospace">find: `/home/mark/.gvfs': Permission denied</font></font></div><div><font size="2"><font class="Apple-style-span" face="'courier new', monospace"><br>

</font></font></div><div><font size="2"><font class="Apple-style-span" face="'courier new', monospace"><br></font></font></div><div><font size="2"><font class="Apple-style-span" face="tahoma, sans-serif">The directory gets created with the attributes:</font></font></div>

<font class="Apple-style-span" face="'courier new', monospace">dr-x------  2 mark mark       0 2011-07-07 21:54 .gvfs</font></font></font><div><font class="Apple-style-span" face="'courier new', monospace"><br>

</font></div><div><font class="Apple-style-span" face="tahoma, sans-serif">Does anyone have any idea how I can get find to not trip up on this directory so the script can exit with the correct return value?</font></div><div>

<font class="Apple-style-span" face="tahoma, sans-serif"><br></font></div><div><font class="Apple-style-span" face="tahoma, sans-serif">Thanks,</font></div><div><font class="Apple-style-span" face="tahoma, sans-serif">Mark</font></div>

<div><div><font class="Apple-style-span" face="tahoma, sans-serif">--</font></div><a href="http://claytoncapers.blogspot.com" target="_blank"><font class="Apple-style-span" face="tahoma, sans-serif">claytoncapers.blogspot.com</font></a><div>

<a href="http://www.mark-clayton.com" target="_blank"><font class="Apple-style-span" face="tahoma, sans-serif">www.mark-clayton.com</font></a></div><div><font class="Apple-style-span" face="tahoma, sans-serif"><br></font></div>

<br>
</div>