作者louisman (匈奴将领)
看板Linux
标题[问题] ubuntu bash let not found
时间Mon Jan 12 20:34:44 2015
刚刚在写bash script的时候
完成後要执行
输入的command
$ sh test.sh
结果出现
let command not found
上网找到答案 原来只要
$ bash test.sh
执行就没有问题了
原因是 bin/sh is dash not bash
听不太懂他的意思 想了解是什麽原因
谢谢~
--
※ 发信站: 批踢踢实业坊(ptt.cc), 来自: 140.117.164.19
※ 文章网址: https://webptt.com/cn.aspx?n=bbs/Linux/M.1421066088.A.C88.html
1F:推 pcchou: ubuntu 预设的 shell 是 dash 01/12 20:59
2F:→ pcchou: 所以你开的根本不是 bash 有些东西是 bash 没有的 01/12 20:59
3F:→ pcchou: s/没有的/才有的/ 01/12 20:59
4F:推 Qiqi: 那source跟.是不是也不一样 01/12 21:03
5F:→ louisman: 感谢一楼 01/12 21:21
6F:→ bitlife: 愣了3秒才看懂3F XD 01/12 22:10
7F:推 l12436: 我也是ubuntu,不过我的预设是bash... 01/12 23:48
8F:→ filiaslayers: ubuntu预设不是一直都是bash吗?有换过? 01/13 10:44
9F:→ bitlife: 14.04是dash 01/13 11:48
10F:→ bitlife: lrwxrwxrwx 1 root root 4 2月 19 2014 /bin/sh -> dash 01/13 11:49
11F:→ kdjf: 10还是11 script shell就改dash了,login还是bash没动 01/13 14:16
12F:→ filiaslayers: 原来有换@@。dash好用吗?我现在都用zsh... 01/13 15:26
13F:→ lantw44: dash 主要是拿来跑 script 用的,直接用不太方便 01/13 15:33
14F:推 rickieyang: 养成习惯在第一行 呛明要用那个 shell 跑就好了。 01/13 23:22
15F:→ pcchou: 推 kdjf: 01/14 07:04
17F:→ fourdollars: 就换过去了 01/14 10:44
18F:→ fourdollars: 可以用指令 `readlink -f /bin/sh` 来检查到底是什麽 01/14 16:49