To the Bash Developers: I'm not sure if this is an issue or not, but the bash test with the -z switch appears to be broken. This code came from the Unix Hacks book I believe and it used to work:
######################################################## # Name: ffind # Desc: finds files from a flat db text file # Args: $1 -> PATTERN - the string you want to look up # Vars: PATTERN, FILELIST - txt file to grep ######################################################## ffind (){ FILELIST="/root/filelist.txt" PATTERN="$1" if [ -z "PATTERN" ]; then echo -n "Search: " read PATTERN fi grep -I "$PATTERN" $FILELIST } If I run the function itself without any input, it should fail the test and prompt me for input, but it doesn't. bash --version GNU bash, version 3.1.17(1)-release (i486-pc-linux-gnu) Copyright (C) 2005 Free Software Foundation, Inc. Sincerely, John Moore