אשכול: עזרה ב BASH
View Single Post
ישן 13-10-08, 12:54   # 2
SDF
חבר בקהילה
דירוג מסחר: (0)
 
מיני פרופיל
תאריך הצטרפות: Sep 2006
מיקום: Negev
הודעות: 270

SDF לא מחובר  

אני לא מבין למה משהו ירצה להשתמש בBASH.

קוד:
SDF@moon ~/inetkey $ ls
test.cnf  test.sh
SDF@moon ~/inetkey $ cat test.cnf 
Users=40
Limits=30
Whatever=sdgsdg
SDF@moon ~/inetkey $ cat test.sh 
#!/bin/bash
users=`awk -F"=" '/Users=[[:digit:]+]/ { print $2 }' test.cnf`
if [ $1 -le $users ] ; then
  echo "OK"
else
  echo "Not ok"
fi

SDF@moon ~/inetkey $ ./test.sh 40
OK
SDF@moon ~/inetkey $ ./test.sh 50
Not ok
SDF@moon ~/inetkey $
__________________
FreeBSD, a *nix operating system