Hi again. I have this code in my shell script but would like to get rid of the rather untidy "if" statement ... I _think_ 'awk' is what I need to be able to read from a plain text file which lists directories NOT to process. Basically doing "if $dirname is not in the text file, then ..." but I can't figure it out or find an example I could hack. Any suggestions are much appreciated.
SOLVED!Code:cd /home for dirname in `find -maxdepth 1 -mindepth 1 -type d | sort` ; do if [ $dirname != "./tech_transfer" -a $dirname != "./transfer" -a $dirname != "./lost+found" ] ; then (rest of script...) fi done
No worries, I found the solution was to use grep, not awk!
Code:if ! grep -q $(basename $dirname) /usr/sbin/dirsize.txt ; then