bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Bash Bugs


From: n3d gonzales
Subject: Bash Bugs
Date: Fri, 13 Jan 2006 19:14:47 +0800

Hello,

I used my old script to my new machine and their's a bug on it.  I have
attached the very simplified script. It will determine whether the file has
space or not. The result is different.

gcc-3.4.3-22.1
bash-3.0-19.2
Red Hat Enterprise Linux ES release 4 (Nahant Update 1)
IBM Intel(R) Xeon(TM) CPU 3.60GHz

Simple Script:
=======================
#!/bin/bash
while read line;do
 if [ -n "$line" ];then
   echo "Without Space, $line"
 else
   echo "Error, With Space"
 fi
done < testing
=======================

testing file:
=======================
2005-04703;;
2005-05286;;
2005-07383;;

2005-09416;;

2005-11217;;
=======================

Result:
Without Space, 2005-04703;;
Without Space, 2005-05286;;
Without Space, 2005-07383;;
Without Space,                    ------------------> This wil be Error,
With Space
Without Space, 2005-09416;;
Without Space,                    ------------------> This wil be Error,
With Space
Without Space, 2005-11217;;


Regards,
Ned


reply via email to

[Prev in Thread] Current Thread [Next in Thread]