- #!/bin/bash
- # Testing the if statement with pwd
- if [ "$(pwd)" ]
- then
- echo "Present working directory is $(pwd)"
- fi
- # Variables for comparison
- var1=20
- var2=10
- # Comparing variables correctly
- if [ "$var1" -gt "$var2" ]; then
- echo "$var1 is greater than $var2"
- else
- echo "$var2 is greater than or equal to $var1"
- fi
- if [ "$var1" -lt "$var2" ]; then
- echo "$var1 is lesser than $var2"
- else
- echo "$var2 is lesser than $var1"
- fi
Tools
- Sandbox
- Paste Code
- Snippets
- Generators
- Checks
- Convertors
[text] shell
Viewer
Editor
Share
Do you find this tool useful? Then share it with your friends or colleagues. This will help us to make our free web tools better.
You can edit this paste and save as new:
Information about embedding
In order to embed this content into your website or blog, simply copy and paste one of the codes provided below.
1. JavaScript Embedding (shows full code, full height depending on amount of lines in paste)
<script src="https://wtools.io/code/embed-js/bVeB"></script>
2. Iframe Embedding (you can set the frame height by adding the CSS value 'height:100px;' for example)
<iframe src="https://wtools.io/code/embed-iframe/bVeB" style="border:none;width:100%"></iframe>