ls /etc/pve/lxc/*([0-9]).conf中工作
/etc/pve/lxc/107.conf中
syntax error near unexpected token `('
ls /etc/pve/lxc/*([0-9]).conf中的括号
ls /etc/pve/lxc/*\([0-9]\).confls: cannot access '/etc/pve/lxc/*([0-9]).conf': No such file or directory发布于 2022-08-27 12:25:11
表达式*([0-9]).conf是KSH风格的扩展glob.该特性默认为交互式bash shell启用,但要在bash脚本中使用它,必须使用
shopt -s extglob发布于 2022-08-27 10:03:16
您没有提供的信息是脚本中使用了哪个命令解释器。这是由谢邦,即第一行(例如。#/bin/sh)。
在Ubuntu中,控制台默认运行bash作为交互式shell。如果您的脚本使用另一个命令解释器(例如/bin/sh ),那么bash特有的语法将无法工作。
https://askubuntu.com/questions/1425956
复制相似问题