Skip to content

Instantly share code, notes, and snippets.

@arnorhs
Created June 18, 2020 12:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save arnorhs/5bc72087c15e29dfc6c51d5227eb9bd7 to your computer and use it in GitHub Desktop.
Save arnorhs/5bc72087c15e29dfc6c51d5227eb9bd7 to your computer and use it in GitHub Desktop.
kill gatsby
#!/bin/bash
# Honestly there must be an easier way to do this, but im a noob
PSAUX="$(ps)"
while IFS= read -r line; do
if [[ $line == *"gatsby develop"* ]]; then
id=$(echo $line | cut -d " " -f 1)
kill -9 $id
echo "killed 'gatsby develop' process $id"
fi
done <<< "$PSAUX"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment