count_line.sh
时间:2010-12-17 来源:xyqcuijia
显示文件行数
#!/bin/bash
read -p "Please assign a file:" FILE
let COUNT=0
if ls -dl $FILE | grep "^-.*" > /dev/null;then
while read LINE; do
let COUNT++
done < $FILE
echo $COUNT
else
echo "The \"FILE\" is not a common file. "
fi
相关阅读 更多 +