但是我不能使用echo语句,所以我要如何打印输出?
用vi编辑器编写的代码
fname=/home/scrapbook/tutorial/unix_countproject/input.txt
read fname
terminal=tty
num_lines=0
num_words=0
while read line
do
num_lines=`expr $num_lines+1`
set $line
num_words=`expr $num_words+$#`
done
exec < terminal
文件的位置是
“ / home / scrapbook / tutorial / unix_countproject / input.txt”
我收到一个错误:
/home/scrapbook/tutorial/script.sh:1: /home/scrapbook/tutorial/script.sh: /home/scrapbook/tutorial/unix_countproject/input.txt:权限 拒绝
/home/scrapbook/tutorial/script.sh:7: /home/scrapbook/tutorial/script.sh:无法打开:没有这样的文件