I was asked to create command which generates one word in terminal, if internet connection is absense, and another one, if it present. For doing that it seems that I need "if" and "else" syntaxis. Is it possible to provide such syntaxis in terminal?
Asked
Active
Viewed 1.4k times
1 Answers
11
$ if [ 'a' = 'b' ]; then echo 'Equal'; else echo 'Not equal'; fi
Not equal
$
Gunnar Hjalmarsson
- 34,191