Shell Scripting Additional Scripts

I noticed that some of the content in the videos does not have any automated scripts so I decided to build some.

Privatebin Resource



#!/usr/bin/env bash
# Put this inside shell-scripting-course/shell-scripting-succinctly/lessons/

# Get script's actual location
# (Different from working directory)
BASEDIR=$(dirname "$0")
# Run the sleepy script in background
./$BASEDIR/sleepy.sh &
# Get and Store process id
TEMP_PID=$!
# Run the lesson code
ps -fp $TEMP_PID
ps -ef | grep $TEMP_PID | grep -v grep
pstree -p $TEMP_PID