#!/bin/sh
if [ $# -gt 1 ]; then   空格也要注意
echo "Uage: $0[FileName]"
exit 1

elif [ $# -eq 1 ]; then
myFileName=$1
echo $myFileName
else
myFileName=$0
echo "/home/hadoop/"$myFileName
fi


if [ ! -f"$file" ];then    //!和-f 之间要有空格
echo "$myFileName does not exit!"
exit 1
fi

MY_LINE_NO=1
while read MY_LINE
do
echo "$MY_LINE:$MY_LINE_NO"
MY_LINE_NO=$((MY_LINE_NO+1))
done<$myFileName

 

 

相关文章:

  • 2021-09-09
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-11-23
  • 2022-12-23
猜你喜欢
  • 2021-12-07
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案