Skip to content
Eternal Center

Eternal Center

  • Single-Node (单节点)
    • System (系统)
    • Service (服务)
    • Database (数据库)
    • Container (容器)
    • Virtualization (虚拟化)
  • Multi-Node (多节点)
    • Cluster (集群)
    • Big Data (大数据)
    • Cloud Computing (云计算)
    • Batch Processing (批量处理)
  • Approach (方式方法)
    • Languages (语言)
    • Ideas (思路)
    • Programing (编程)
    • Project (项目)
  • Eternity (永恒)
    • News (消息)
    • Creations (创作)
    • Classics (经典)
    • Legends (传说)
    • Chronicle (编年史)
    • FNIOS (宇宙公民开源学院)
Posted on September 7, 2022April 11, 2023 by Mingyu Zhu

[排错] 解决 Linux 执行 Shell 脚本时报错 “[: ……: unary operator expected”

  • 报错代码
  • 解决方法

报错代码

[: ......: unary operator expected

解决方法

# vim <Shell Script>

将以下内容修改为:

......
if [[ ...... ]]; 
......

修改为:

......
if [[ ...... ]]; 
......
CategoriesChinese Post (中文帖子), Programming (编程), Shell, Shell Basic (基础)

Post navigation

Previous PostPrevious [步骤] Linux SSH 加密方式 (cipher) 、信息验证代码 (message authentication code) 和算法 (algorithm) 的设置 (Ciphers、MACs 和 KexAlgorithms 参数的设置) (不使用来自 crypto policies 的系统全局设置) (RHEL 8 版)
Next PostNext [排错] Linux 解决执行 service crond status 命令时,报错 “crond dead but pid file exists”

Aspiration (愿景):

Everyone can achieve self-achievement and self-happiness fairly

每个人都能公平地实现自我成就和自我幸福

Logo (徽标):

Additional Information (其他信息):

About     Manual     Clone     Contact
Disclaimer     Friendly Links     Donation

关于     手册     克隆     联系
免责声明     友情链接     捐赠

Search Inside Website (站内搜索)

Search Outside Website (站外搜索):

Google         Wikipedia         Bing

Eternal URL (永恒网址):

https://eternity.eternalcenter.com Will be last access method / 将是最后的访问方式

Proudly powered by LNMP Proudly powered by WordPress