题目描述
linux下创建的软链接要怎么执行
题目来源及自己的思路
相关代码
// 请把代码文本粘贴到下方(请勿用图片代替代码)
[2016@localhost ~]$ ls
hello.sh hello.sh.bak output2.txt out.txt test.txt
[2016@localhost ~]$ hello
-bash: hello: command not found
[2016@localhost ~]$ hello.sh
-bash: hello.sh: command not found
[2016@localhost ~]$ ./hello.sh
-bash: ./hello.sh: No such file or directory
你期待的结果是什么?实际看到的错误信息又是什么?
无论输入
hello
hello.sh
./hello.sh
都执行不了。
此问题终结
先vi hello.sh 然后什么都不做 直接":"+"wq"
然后再./hello.sh 就能执行了~
因为 hello.sh 指向的文件不存在了,所以执行
./hello.sh
报-bash: ./hello.sh: No such file or directory
错误