samedi 4 juin 2016

Syntax error, missing "]"

I've a bash script, and the shell tell me "Missing ']' on line 3".

The line 3 : if [ $# -ne 1 ] && [ $# -ne 2 ], and here my script:

#!/bin/bash

if [ $# -ne 1 ] && [ $# -ne 2 ]
then
    echo "Syntaxe: $0 <host> [ <user> ]"
    exit 1
fi

Aucun commentaire:

Enregistrer un commentaire