User Tools

Site Tools


burim:linux-essentials:chapter-9-basic-scripting
conditionals

---

if somecommand; then
  # do this if somecommand has an exit code of 0
fi

---

#!/bin/bash

if grep -q root /etc/passwd; then
  echo root is in the password file
else
  echo root is missing from the password file
fi

---
burim/linux-essentials/chapter-9-basic-scripting.txt · Last modified: 2018/08/24 12:55 by dardan

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki