一个典型的简单shell字符串处理脚本

来源:互联网 发布:system halted linux 编辑:程序博客网 时间:2024/04/30 15:58

limit=`expr $end - $start`

let switch_vlan_cnt+=1


#!/bin/sh

fuck="/home/test_stdio/data"

echo "let's start" > out
while read line 
do
#       echo $line
        tmp1=$(echo $line | awk -F'[;]' '{print $1}')
        if [ -z "$tmp1" ]
        then
                echo "" >> out
        else
                echo "msgid \"$tmp1\"" >> out
                tmp2=$(echo $line | awk -F'[;]' '{print $2}')
                echo "msgstr \"$tmp2\"" >> out
        fi
done < $fuck
0 0