文件存在性
#!/bin/bash
echo "please input file name"
read f_name
if [ -z
$f_name ]
then
echo "you don't input any file name"
fi
if [
-f $f_name ]
then
echo "The file. exits $f_name"
else
echo "No such. file"
fi
exit 0
文件操作
#!/bin/bash
ARGS=
1
if [
$# -ne $ARGS ]
then
echo "`basename $0` filename"
exit 0
fi
if [ !
-f $1 ]
then
echo "No such file"
exit 0
fi
sed
-e 's/\.//g' -e 's/\.//g' -e 's//\
/g' "$1" | tr
'A-Z' 'a-z' | sort | uniq -c | sort -nr
exit 0
转载请注明原文地址: https://ju.6miu.com/read-970870.html