shell-027 shell常见错误集锦

001.[root@pyzc-mycat test]# ./expect130.expect
wrong # args: should be "set varName ?newValue?"
    while executing
"set host "192.168.106.130"  #在expect里定义变量是需要加set 这里定义host为第二台机器"
    (file "./expect130.expect" line 2)

https://stackoverflow.com/questions/34095529/tcl-error-wrong-args-should-be-set-varname-newvalue
That message:
        wrong # args: should be "set varName ?newValue?"
is a standard error thrown when a built-in command gets the wrong number of arguments to evaluate. In this case, it's coming from the set command, and indicates that you've either said set on its own, or given more than two further arguments to it.
If you examine the stack trace (usually printed with the error message when using standard tclsh, though it's changeable with user code) then you'll get told where the problem happened. However,in this case we can look through and see that this line near the bottom of the script:
       set ag_around_water resid [$ag_around_water get resid]
has what appears to be a space instead of an underscore in the variable name. Now, spaces arelegal in variable names, but then the variable name needs to be quoted, and that can get a bit annoying. It's usually best to avoid using them like that. Without quoting, Tcl doesn't know that that's meant to be one word; the generic parsing layer decides there's really four words there (setag_around_waterresid and the complex [$ag_around_water get resid]) and tells set to deal with that, which it doesn't like.
Remember, Tcl's generic syntactic parsing happens first, before command arguments are interpreted semantically. Always.

002.[root@pyzc-mycat test]# ./expecttr.expect root 192.168.106.130 w
spawn ssh root#这里定义第一个递归参数@192.168.106.130#定义第二个参数
ssh: Could not resolve hostname 192.168.106.130#\345\256\232\344\271\211\347\254\254\344\272\214\344\270\252\345\217\202\346\225\260: Name or service not known
send: spawn id exp6 not open
    while executing
"send "$cm\r""
    (file "./expecttr.expect" line 13)

#的注释请另起一行

003.[root@pyzc-mycat ~]# rsync -av root@192.168.106.130:/tmp/12.txt /tmp/
root@192.168.106.130's password: 
bash: rsync: 未找到命令
rsync: connection unexpectedly closed (0 bytes received so far) [Receiver]
rsync error: remote command not found (code 127) at io.c(226) [Receiver=3.1.2]

线上的目标服务器没有安装rsync导致(两端服务器都要安装yum install -y rsync)

  • 0
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
### 回答1: gnome-shell-extension-prefs 是一款GNOME Shell扩展程序,它允许用户在GNOME桌面环境中自定义和调整一些设置。然而,根据您的描述来看,您可能遇到了一些问题,导致该扩展无法在Ubuntu 22上安装。 首先,我建议您确认您的操作系统的版本号是否准确。Ubuntu 22 并不是一个官方的Ubuntu版本,因此您可能遇到了不同于官方支持的问题。 如果您是指的是 Ubuntu 20.04 LTS 或者其他类似的版本,然后还是无法安装 gnome-shell-extension-prefs ,有几个可能的原因: 1. 软件源设置不正确:请确保您的软件源设置正确。在终端中可以使用命令 `sudo apt update` 更新您的软件包列表,并确保您的系统已连接到正确的软件源。 2. 包管理器错误或损坏:尝试使用以下命令修复并重建您的包管理器: ```shell sudo apt clean sudo apt autoclean sudo apt update sudo apt upgrade ``` 3. 引入的依赖项不匹配:某些软件包可能需要与gnome-shell-extension-prefs扩展兼容的特定依赖项。您可以尝试安装缺失的依赖项来解决该问题。例如,运行以下命令安装常见的GNOME Shell扩展所需的依赖项: ```shell sudo apt install chrome-gnome-shell ``` 4. 扩展版本不匹配:确保您正在尝试安装与您使用的GNOME Shell版本兼容的gnome-shell-extension-prefs。如果您的GNOME Shell版本较新,可能需要等待开发者更新该扩展以支持最新版本。 最后,如果您遵循以上步骤仍然无法安装 gnome-shell-extension-prefs,您可以尝试在GNOME Shell扩展官方网站上寻找其他类似的扩展来实现您需要的定制和调整功能。或者,您可以考虑向GNOME社区报告该问题,以取得更多支持和解决办法。 请注意,以上只是一些可能的解决方案,并不能确保一定能够解决您的问题。具体情况可能因您的系统配置和操作方式而有所不同。因此,您可能需要进一步研究和尝试其他方法来解决该问题。 ### 回答2: 在Ubuntu 22上无法安装gnome-shell-extension-prefs是因为该软件包可能在该Ubuntu版本的软件仓库中不可用。这可能是由于该软件包尚未进行适配或更新以与Ubuntu 22兼容。 通过安装gnome-shell-extension-prefs,您可以在GNOME Shell环境中对其扩展进行自定义和配置。由于该软件包无法安装,可能会导致无法通过GUI界面对GNOME Shell扩展进行配置。 解决这个问题的一个可能的方法是等待软件包作者适配并发布与Ubuntu 22兼容的版本。您可以定期检查软件包的更新,并在其可用时进行安装。 另一个解决方法是手动安装gnome-shell-extension-prefs。这需要您从官方GNOME Shell Extensions网站(https://extensions.gnome.org/)下载软件包的源代码,并按照相关的安装说明进行安装。但是,请注意,手动安装可能需要了解一些命令行操作和系统配置知识,并且可能会导致系统不稳定或出现其他问题。 最后,您还可以尝试使用其他类似的软件,如dconf-editor,它 是一个功能强大的配置编辑器,可以用于对GNOME Shell扩展进行配置。您可以通过apt-get或Ubuntu Software Center进行安装和使用。 总之,在Ubuntu 22上无法安装gnome-shell-extension-prefs可能是由于软件包不兼容或未适配导致的。您可以等待更新、手动安装或尝试其他类似的软件来进行GNOME Shell扩展的配置。 ### 回答3: 在Ubuntu 22上安装gnome-shell-extension-prefs可能会遇到一些问题。gnome-shell-extension-prefs是一个用于管理GNOME Shell扩展的工具。首先,确保你的系统已经安装了GNOME Shell,可以通过运行命令"gnome-shell --version"来检查。如果你没有安装它,可以通过命令"sudo apt install gnome-shell"来安装。 接下来,确保你的系统已经安装了GNOME Tweak Tool,这是一个用于管理GNOME Shell的工具集。你可以通过运行命令"sudo apt install gnome-tweak-tool"来安装它。 如果你遇到了依赖问题,可能需要运行"sudo apt --fix-broken install"来修复依赖关系。 一旦你确认你的系统已经安装了GNOME Shell和GNOME Tweak Tool,你就可以尝试安装gnome-shell-extension-prefs了。你可以通过运行命令"sudo apt install gnome-shell-extension-prefs"来安装它。 如果上述步骤无法解决问题,你也可以尝试从GNOME Extensions网站手动下载和安装扩展。首先,打开Firefox浏览器并访问https://extensions.gnome.org/。在此网站上,你可以搜索并找到gnome-shell-extension-prefs。点击扩展页面上的"Toggle switch"按钮以启用扩展,并按照网站提供的说明进行安装。 如果你遇到了其他问题,建议参考官方文档、论坛或提问社区来寻求帮助。理论上,gnome-shell-extension-prefs在Ubuntu 22上是可以安装和使用的,但在特定的系统配置和环境下可能会出现一些问题。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值