
Bevor Sie dies als Duplikat markieren, haben Sie bitte Verständnis dafür, dass ich nach diesem Problem gesucht und bereits alle Lösungen ohne Erfolg ausprobiert habe.
Mein Skript:
#!/bin/bash
echo "Enter the number 3"
read t1
if [$t1 -eq 3]; then
echo "it is 3"
elif [$t1 > 3]; then
echo "it is greater than 3"
fi
exit 0
Der Fehler, den ich bekomme, ist:
./g.sh: line 5: [3: command not found
./g.sh: line 7: [3: command not found
Antwort1
benötigte Plätze if [ $t1 -eq 3 ]