Remove shell script after usage

Remove shell script after usage

Here is a small script that does two things:

  1. Determinate script’s location
  2. Delete the file
#!/usr/bin/env bash

// determinate where the script is
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )

// delete the script
rm -f $SCRIPT_DIR/test.sh 

whoami
Stefan Pejcic
Join the discussion

I enjoy constructive responses and professional comments to my posts, and invite anyone to comment or link to my site.