1
|
bash: ./du2.sh: /bin/bash^M: bad interpreter: No such file or directory
|
在win平台下输入/bin/bash的脚本,运行报错。
因为win下默认编辑器的回车是crlf。改成lf就好了
while read 可以读取文件的每一行.
read -p 可以读取指令。
1 2 3 4 5 6 7 8 9
|
#!/bin/bash cat 2 | while read line do echo "$line" done read -p "niaiwome?" name echo "$name"
|
近期评论