im trying to right a if statement in bash that will exit if the variable supplied is not an integer. I will eventually be nesting this if statement within a while loop.
when I do run this I am getting an syntax error.
#!/bin/bash
if [ $f1 != ^[0-9]+$ ]
then
exit 1
fi
Aucun commentaire:
Enregistrer un commentaire