X-Recipient: archive-cygwin AT delorie DOT com X-Spam-Check-By: sourceware.org Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Subject: RE: bash programming: testing for empty string Date: Wed, 5 Mar 2008 10:45:42 +0100 Message-ID: <574BF80562AF37419EA4B003C90D756D031FEE2C@EXCHANGE1.belgium.fhm.de> In-Reply-To: From: "Morche Matthias" To: X-IsSubscribed: yes Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com Note-from-DJ: This may be spam Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by delorie.com id m259l5PB003270 try [ -z "$filetime" ] instead of [-z "$filetime"] matthias -----original message----- From: cygwin-owner AT cygwin DOT com [mailto:cygwin-owner AT cygwin DOT com] Sent: Wednesday, 5. March 2008 10:28 To: cygwin AT cygwin DOT 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/