Fix so that grep won't hang when currency requested starts with a "-"
authorJean-Michel Nirgal Vourgère <jmv@nirgal.com>
Mon, 10 Mar 2008 15:55:52 +0000 (15:55 +0000)
committerJean-Michel Nirgal Vourgère <jmv@nirgal.com>
Mon, 10 Mar 2008 15:55:52 +0000 (15:55 +0000)
curcy

diff --git a/curcy b/curcy
index f437d06135c4d7978c10aa7fd8983e599d2ad4d8..b7ae11b832a38f851aa9b520321586a997d37b09 100755 (executable)
--- a/curcy
+++ b/curcy
@@ -21,7 +21,7 @@ fi
 #echo "1 euro = $local_currency_value $local_currency"
 
 target_currency=$1
-target_currency_value=`grep $target_currency /var/currencies | cut -d \  -f 2`
+target_currency_value=`grep -e $target_currency /var/currencies | cut -d \  -f 2`
 if [ -z "$target_currency_value" ]; then
     echo "The currency $target_currency is unavailable in exchange rate database"
     exit 1