海王  
#! /bin/ash
#read string from file

filecon=$(cat /root/surces/tmp/scrtxt)  

#get string follow ";DES:" 

filename=${filecon#*;DES:}
if [ ${#filecon} == ${#filename} ] #string lenth
 then
        echo "no match"
        exit 1
fi
cutpos=$(expr index "$filename" ';')   #get position
let cutpos=cutpos-1
filename=${filename:0:$cutpos}  #cut strings
echo "filename :  "$filename

echo $(expr index "$filename" ' ')
filename=${filename/ /-}   #replace first found
filename=${filename// /_}     #replace all
filename=$filename

filename=$(echo $filename | tr '[A-Z]' '[a-z]')   #replace

echo $filename
export WWW="ename"

posted on 2011-01-05 16:16  海王  阅读(2195)  评论(0编辑  收藏  举报