Ubuntu Bash and Dash
来源:互联网 发布:retrofit json实体 编辑:程序博客网 时间:2024/05/20 17:27
Ubuntu的 shell 默认安装的是 dash,而不是 bash。
运行以下命令查看 sh 的详细信息,确认 shell 对应的程序是哪个:
$ls -al /bin/sh
dash 比 bash 更轻,更快。但 bash 却更常用。
如果一些命令、脚本等总不能正常执行,有可能是 dash 的原因。
比如编译 Android 源代码的时候,如果使用 dash,则有可能编译出错,或者编译的系统不能启动。
通过以下方式可以使 shell 切换回 bash:
$sudo dpkg-reconfigure dash
然后选择 no 或者 否 ,并确认。
这样做将重新配置 dash,并使其不作为默认的 shell 工具。
也可以直接修改 /bin/sh 链接文件,将其指定到 /bin/bash:
$sudo ln -fs /bin/bash /bin/sh
还有一种解决方法是,在脚本文件中直接指定使用的 shell,而不是指定 sh:
例如使用 #!/bin/bash 或者 #!/bin/dash 而不是#!/bin/sh。
但这样将丧失脚本的通用性,使其在不具备所指定脚本的系统下不能被执行。
运行以下命令查看 sh 的详细信息,确认 shell 对应的程序是哪个:
$ls -al /bin/sh
dash 比 bash 更轻,更快。但 bash 却更常用。
如果一些命令、脚本等总不能正常执行,有可能是 dash 的原因。
比如编译 Android 源代码的时候,如果使用 dash,则有可能编译出错,或者编译的系统不能启动。
通过以下方式可以使 shell 切换回 bash:
$sudo dpkg-reconfigure dash
然后选择 no 或者 否 ,并确认。
这样做将重新配置 dash,并使其不作为默认的 shell 工具。
也可以直接修改 /bin/sh 链接文件,将其指定到 /bin/bash:
$sudo ln -fs /bin/bash /bin/sh
还有一种解决方法是,在脚本文件中直接指定使用的 shell,而不是指定 sh:
例如使用 #!/bin/bash 或者 #!/bin/dash 而不是#!/bin/sh。
但这样将丧失脚本的通用性,使其在不具备所指定脚本的系统下不能被执行。
0 0
- ubuntu bash and dash
- Ubuntu Bash and Dash
- Ubuntu Bash and Dash
- Ubuntu Bash and Dash
- ubuntu dash shell and bash shelll
- Bash and Dash
- ubuntu 切换bash,dash
- Ubuntu shell脚本:bash / dash
- ubuntu shell环境 dash bash
- ubuntu dash shell 改为 bash
- ubuntu默认dash改为bash
- ubuntu dash shell 改为 bash
- ubuntu将dash变为bash
- 修改Ubuntu dash shell为bash shell
- 修改 ubuntu dash shell为bash shell
- Ubuntu 的 bash和dash的区别
- 在ubuntu下把dash换成bash
- Ubuntu的shell之bash和dash
- java基础常见面试题
- day05HTML DOM内置对象
- ActiveMQ SSL应用之二 使用keytool工具生成密钥和证书文件
- 稳定与未知,你到底会选择哪一个?
- html5 — JSON的新方法
- Ubuntu Bash and Dash
- 二.Contiki之事件
- FZU 2150 Fire Game ([kuangbin带你飞]专题一 简单搜索)
- 简单01背包
- Python 主要模块和常用方法简览
- [IDE] 无图形Linux环境下的程序开发IDE: vicc 发布会 - 2
- 动态规划的关键 —— 子问题 & 公式化
- unity3d AI 学习--个体行为操控(1)
- STM32的存储器映射