---
description: In this lab, we explored basic BASH scripting
---

# Lab09 - BASH Scripting

## Commands to find Information on BASH Environment

* `bash -version | grep version` - BASH version installed
* `which bash` - where the BASH program resides
* `echo $PATH` - [Path Environment Variable](https://en.wikipedia.org/wiki/PATH\_\(variable\))
* `env` - [Environment Variables](https://www.techrepublic.com/article/linux-101-what-are-environment-variables/)
* `history` - shows previous commands executed

## Check if substring is in string

`if [[  $string =~ "substring" ]]; then`

* Ping sweeper script

<figure><img src="../assets/72455756211919931734.png" alt=""><figcaption></figcaption></figure>

* nslookup script

<figure><img src="https://lh7-us.googleusercontent.com/IKQIndPY0hAvn2fDJTtTBRb4CRJ6dzCMFQAZArjp3VfaE00BtvxBj6FZZcvUBCwx-rZw6BkQkIcjoOt8PcNBgQFe_iu1aFde_yg-gxNNxEn3OsSSReVV7Y2ZY1tTr4nhw21-izfg2T10FHsscQeG7A" alt=""><figcaption></figcaption></figure>
