首先阐述几个命令

echo $0   显示当前使用的shell版本

dpkg-reconfigure 设置软件包类型


脚本报错原因:

Ubuntu默认使用的shell解析是dash,dash只有bash一部分的功能


首先我的系统执行

$  echo $0

-bash

$   sudo dpkg-reconfigure dash

执行shell脚本时报错let: not found的几种解决方法

选择 No,使用bash作为默认shell


此时依然无法解决问题

经过试验

方法一:

脚本中#/bin/bash改为!/bin/sh

方法二:

使用bash shell_name.sh





转载于:https://blog.51cto.com/mengix/1827498

相关文章:

  • 2022-12-23
  • 2021-08-27
  • 2021-09-27
  • 2022-12-23
  • 2022-12-23
  • 2021-07-11
猜你喜欢
  • 2021-08-21
  • 2021-07-25
  • 2022-01-23
  • 2021-12-04
  • 2021-09-10
相关资源
相似解决方案