Yohanes Nugroho wrote:
Halo,

2009/12/1 Hari Hendaryanto <har...@csmcom.com>:
#!/bin/bash
if [ -z "`echo $1 | awk '/^[[:space:]]+/{print}'`" ]; then

tambahkan kutip di antara $1, jadi

if [ -z "`echo "$1" | awk '/^[[:space:]]+/{print}'`" ]; then
it work!!! :) thanks


lalu saya install gawk dan jadi jalan. Mungkin pakai egrep (pake "e"
bukan grep biasa, atau pake grep -E) lebih portabel:

#!/bin/sh
echo "$1" | egrep -q ^[[:space:]]
if [ $? == 0 ]; then
        echo "NOT OK";
else
        echo "OK";
fi


it work  juga :)

kesimpulan cuma kekurangan doublequote aja di parameter $1

thanks


PT.CITRA SARI MAKMUR
SATELLITE & TERRESTRIAL NETWORK

Connecting the distance - anytime, anywhere, any content
http://www.csmcom.com


--
Berhenti langganan: linux-programming-unsubscr...@linux.or.id
Arsip dan info: http://linux.or.id/milis

Kirim email ke