bootleg86 wrote on Wednesday, March 05, 2008 9:28 AM::
> 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
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
2 matches
Mail list logo