脚本执行常见错误:build.sh: caller: not found

本文涉及的产品
云解析 DNS,旗舰版 1个月
全局流量管理 GTM,标准版 1个月
公共DNS(含HTTPDNS解析),每月1000万次HTTP解析
简介: 从Ubuntu 6.10开始,默认使用dash(theDebian Almquist Shell)而不是bash(the GNUBourne-Again Shell)但Login Shell还是bash. 原因是dash更快、更高效,而且它符合POSIX规范。Ubuntu在启动的时候会运行很多shell脚本,使用dash可以加快启动速度。

1 bash与dash


从Ubuntu 6.10开始,默认使用dash(theDebian Almquist Shell)而不是bash(the GNUBourne-Again Shell)但Login Shell还是bash. 原因是dash更快、更高效,而且它符合POSIX规范。Ubuntu在启动的时候会运行很多shell脚本,使用dash可以加快启动速度。


2 执行脚本常常会有一些不知名的错误


比如:build.sh: caller: not found


我还遇到过还有一些其他莫名其妙的错误


先看下自己的脚本是用bash解析还是dash解析的,脚本我们一般默认都是用bash


先用命令ls -l /bin/sh看看自己系统的脚本解析


3 切换sh为bash/dash


sudo dpkg-reconfigure dash


出现一个界面选择切换为bash解析即可解决:build.sh: caller: not found


切换回去重新执行一遍命令选择即可

目录
相关文章
|
数据库管理
SVN 执行cleanup报错:Cleanup failed to process the following paths : 解决方法
引用:https://www.cnblogs.com/pinpin/p/11395438.html 在SVN更新时提示文件被锁住了,要求执行 clean up操作,执行clean up时又报clean up failed。造成的原因是在某次更新后,点击了cancel按钮,操作没有完成所以会锁住。解决方法如下:
1099 0
|
3月前
|
Shell Android开发
./build_native.sh执行错误
./build_native.sh执行错误
|
16天前
|
资源调度
安装项目的时候老是报错:Command failed.
安装项目的时候老是报错:Command failed.
|
Ubuntu 关系型数据库 MySQL
提示-bash: command not found的解决方法集锦
提示-bash: command not found的解决方法集锦
|
开发工具 git
【经验分享】【Github】Error: Action failed with “The process ‘/usr/bin/git‘ failed with exit code 128“
【经验分享】【Github】Error: Action failed with “The process ‘/usr/bin/git‘ failed with exit code 128“
314 0
在处理时有错误发生: trousers tpm-tools E: Sub-process /usr/bin/dpkg returned an error code (1)
在处理时有错误发生: trousers tpm-tools E: Sub-process /usr/bin/dpkg returned an error code (1)
在处理时有错误发生: trousers tpm-tools E: Sub-process /usr/bin/dpkg returned an error code (1)
|
JavaScript Linux Windows
imagemagick安装调用报错command failed
记录下通过nodejs调用imagemagick 的时候发现的一个错误,command failed -- crop .
imagemagick安装调用报错command failed
|
移动开发 Linux Shell
$‘\r‘: command not found的解决方法
在Linux系统中,运行Shell脚本,出现了如下错误: one-more.sh: line 1: $'\r': command not found 1 出现这样的错误,是因为Shell脚本在Windows系统编写时,每行结尾是\r\n,而在Linux系统中行每行结尾是\n,所以在Linux系统中运行脚本时,会认为\r是一个字符,导致运行错误。
1322 0
|
移动开发 Unix Shell
执行shell脚本时提示bad interpreter:No such file or directory的解决办法
执行shell脚本时提示bad interpreter:No such file or directory的解决办法
1238 0