Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ################################################################################
- # Function: chomp_slash
- # Description: Removes any trailing slash ("/") from a string
- # Arguments: $1 :- String from which to remove any trailing slashes
- # Ouputs: Prints string with trailing slashes removed
- function chomp_slash {
- local dir="$1"
- while [ "${dir:(-1)}" = '/' ]; do
- dir=${dir::-1}
- done
- echo "${dir}"
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement