Quote:
+ dev=/biddf/ab6498/dev/ctl
+ cd /biddf/ab6498/dev/ctl
+ echo /biddf/ab6498/dev/ctl
/biddf/ab6498/dev/ctl
+ myfilepattern=CARE01_DLY
+ + date +%Y%m%d
fullpattern=CARE01_DLY_???_20060724
+ typeset -i filecount=0
+ [ CARE01_DLY_AUS_20060724 != CARE01_DLY_???_20060724]
./script4.ksh[11]: test: ] missing
+ [ CARE01_DLY_MKT_20060724 != CARE01_DLY_???_20060724]
./script4.ksh[11]: test: ] missing
+ let 0 == 1
+ print failure
failure
+ exit 1
|
Sorry, type error
Add a space befor the ] in the test statement whithin the for loop
Code:
#!/bin/ksh
dir=/biddf/ab6498/dev/ctl
export dir
set -x
myfilepattern=$@
fullpattern=${my_filepattern}_???_$(date +%Y%m%d)
integer filecount=0
for file in $fullpattern ; do
[ "$file" != "$fullpattern" ] && filecount=$filecount+1
done
if (( $filecount == 10 )); then
print "success"
exit 0
else
print "failure"
exit 1
fi