Skip to content

Instantly share code, notes, and snippets.

@chazcheadle
Created October 5, 2016 14:23
Show Gist options
  • Save chazcheadle/8c231c5ac33119594177b86aee43312b to your computer and use it in GitHub Desktop.
Save chazcheadle/8c231c5ac33119594177b86aee43312b to your computer and use it in GitHub Desktop.
Bash: Get final path element in working directory
#!/bin/bash
# ex> '/home/on/the/range' will return 'range'
WORKDIR=${PWD##*/}
echo $WORKDIR
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment