Getting “command not found” error while comparing two strings in Bash

后端 未结 4 1744
失恋的感觉
失恋的感觉 2020-11-22 12:19

My whole Script is currently this:

#!/bin/sh   
clear;   
blanko=\"\";   
# Dummy-Variablen
variable=Testvariable;   
if [[$variable == $blanko]];
then   
           


        
4条回答
  •  情歌与酒
    2020-11-22 13:13

    This is problem:

    if [[$variable == $blanko]];
    

    Spaces are required inside square brackets, use it like this:

    [[ "$variable" == "$blanko" ]] && echo "Nichts da!" || echo "$variable"
    

提交回复
热议问题