if directly upload the script. into unix sever and run it,it occurs some strange issues like '`/data/informatica/HQ/FRGHT01/SrcFiles/INFA\r/TRAX_paidEnergy.dat\r' \r,then copy the script. content in WINDOWS then paste into the script. in UNIX vi.and in the new vi file,first insert one blank line,then copy.it will get fully paste,otherwise not fully.
compress
compress 是一个相当古老的 unix 档案压缩指令,压缩后的档案会加上一个 .Z 延伸档名以区别未压缩的档案,压缩后的档案可以以 uncompress
eg---compress *.txt
result--xxxx.txt.Z
tar 可以为文件和目录创建档案(backup)
tar -cf xx.tar *.Z
eg--将所有*。Z的文件放到xx.tar的包里。-c是表示产生新的包 ,-f指定包的文件名
find 文件名匹配
eg---F_cnt=`find -name "*.Z"|wc -l`
find与grep 正好相反,只要不用*,必须精确匹配,差一个字母都不行
精确匹配
$ find /etc -name hosts
/etc/hosts
/etc/inet/hosts
模糊匹配
$ find /etc -name “host*”
/etc/hosts
/etc/inet/hosts
wc -l 统计结果
eg--find -name "*.Z"|wc -l--找到几个。Z的文件
F_cnt=`find -name "*.Z"|wc -l`
`` ---保有command means
rm -f $file_path/$log_file_name
yn=`echo $?`
echo $yn
the former command whether execute success.use echo $yn,if 0,then success.other value,it fail
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/25676270/viewspace-723291/ ,如需转载,请注明出处,否则将追究法律责任。