[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
test with -z switch fails with Debian Linux
From: |
John Moore |
Subject: |
test with -z switch fails with Debian Linux |
Date: |
Fri, 21 Dec 2007 15:38:42 -0600 |
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
- test with -z switch fails with Debian Linux,
John Moore <=