在Ubuntu系统中执行脚本的时候突然出现错误“source command not found in sh shell”

这个其实在Ubuntu 当中 执行脚本默认的使用的是dash,而非bash

通过命令

#ls -l `which sh`
# /bin/sh -> dash

我们发现, 脚本中默认使用的sh其实对应的是dash, 而不是bash。 为了解决这个错误我们就需要把这个对应关系修改下, 让sh对应到bash

执行以下命令, 在弹出的框里面选择No即可把sh对应的链接修改成bash

#sudo dpkg-reconfigure dash
//若下图所示, 选择否就可以修改对应的关系, 修改完成之后再执行ls -l `which sh`就可以看到, 对应关系已经修改过来了, 可以正常的执行脚本了

source command not found in sh shell解决办法的更多相关文章

  1. 【转】Source Insight中文注释为乱码的解决办法

    我网上查了一堆解决办法,但是都是2017年以前的,并且都是针对于source insight 3.5及以下版本的解决方案,软件版本都到4.0了,应该有新方法出现. 干货:Source Insight ...

  2. macOS Mojave 10.14 无法安装brew缺少Command Line Tools for Xcode的解决办法

    问题描述: 首先我的版本是 Xcode 10.1 如果按照以前的方法安装brew 复制 1 /usr/bin/ruby -e "$(curl -fsSL https://raw.github ...

  3. Warning: Using a password on the command line interface can be insecure.解决办法

    被一个小朋友问到,直接公布答案: If your MySQL client/server version is a 5.6.x a way to avoid the WARNING message a ...

  4. maven source 1.3 中不支持泛型 解决办法

    maven打包时始终出现以下提示:1.-source 1.3 中不支持泛型(请使用 -source 5 或更高版本以启用泛型)List<User> userList= new ArrayL ...

  5. MySQL Warning: Using a password on the command line interface can be insecure.解决办法

    转自 http://www.cnblogs.com/sunss/p/6256706.html  被一个小朋友问到,直接公布答案: If your MySQL client/server version ...

  6. ubuntu18.04 出现 Command 'ifconfig' not found 问题的解决办法

    我们在虚拟主机中查看ip地址需要输入ifconfig,但是报以下错误: 系统提示我们安装 net-tools,当我们输入以下命令,即可安装完成. sudo apt-get install net-to ...

  7. CentOS5/6/7系统下搭建安装Amabari大数据集群时出现SSLError: Failed to connect. Please check openssl library versions.错误的解决办法(图文详解)

    不多说,直接上干货! ========================== Creating target directory... ========================== Comman ...

  8. 【Supervisor】使用 Supervisor source command not found 如何解决

    结论: The source command is only available in bash, and the supervisor command is run by sh. I would r ...

  9. Ubuntu解决sudo: source: command not found错误

    Ubuntu Server上执行以下命令,可以看到默认打开的文件数限制为1024个. $ ulimit -n 1024 编辑/etc/profile配置文件,在最后添加一行: ulimit -SHn ...

随机推荐

  1. Centos 6.4下使用VSFTPD无法正常连接与无法上传文件的问题解决

    发表于 2014 年 4 月 13 日 作者 SCKA 最近利用Linux搭建服务器 搭建FTP的时候决定使用VSFTP搭建,结果却出现了无法正常连接与无法上传文件等诸多问题 经过许久的努力,终于让V ...

  2. UVA 11992 线段树

    input r c m      r<=20,1<=m<=20000 m行操作 1 x1 y1 x2 y2 v       add v 2 x1 y1 x2 y2 v       s ...

  3. ABI & API

    API defines the programning language and function entry point, arguments type, order. ABI defines th ...

  4. About struct in C

    something new: to set value in struct can be in case i cannot view picture.. i write the snippet her ...

  5. ThreadLocal类及常用的线程安全类探究

    1.ThreadLocal类 ThreadLocal是Thread Local Variable的简称,意思是线程局部变量.作用是为每一个使用该变量的线程都提供一个该变量的副本,使每一个线程都能独立操 ...

  6. required 引发的小小思考

    原创:转载请注明出处 首先,因为遇到问题如下: class MainTabBar: UITabBar { override init(frame: CGRect) { super.init(frame ...

  7. php cookies自动登录

    <?php header('Content-type: text/html; charset=utf-8'); error_reporting(0); //自动登陆 if($_COOKIE[&q ...

  8. IE6下整站的bug详解

    <1>文字不居中:加一个行高: <2>png文件作为背景不显示: <!--[if IE 6]> <script src="js/DD_belated ...

  9. Lucene中的合并因子mergeFactor

    mergeFactor 是用来决定segment该如何被addDocument()方法进行合并的. 当mergeFactor取比较小的值时,索引时所使用的内存较少 而且搜素未优化的速度会比较快.因此, ...

  10. java 创建一个File文件对象

    Example10_1.java import java.io.*; public class Example10_1 { public static void main(String args[]) ...