Votes: 2
Link:
🔍 See Original Answer on Ask Ubuntu ⧉ 🔗
URL:
https://askubuntu.com/q/1060425
ID:
/2018/07/29/
Created:
July 29, 2018
Upload:
January 1, 2025
Layout: post
TOC:
false
Navigation: false
Copy to clipboard: false
I would use this:
[[ $(Command1) == 1234 ]] && Command2
- The
[[
and]]
tests if the condition inside is true &&
executesCommand2
if the condition tested true$(...)
executes command inside parenthesis and returns output (what was echoed insideCommand1
```
```