try [ -z "$filetime" ] instead of [-z "$filetime"] matthias
-----original message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Wednesday, 5. March 2008 10:28 To: cygwin@cygwin.com Subject: bash programming: testing for empty string Hi, I'm trying to find the time of a file by doing this. filetime=`ls -l --time-style=+%a:%H:%M /tmp/1.txt | awk '{print $6}'` if [ -z "$filetime"]; then echo "File does not exist" else echo "Time file: $filetime" fi ... -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/