Created
November 1, 2019 10:20
-
-
Save odellt/f1423e75bb0e3e3f66a7d82362bf2cd7 to your computer and use it in GitHub Desktop.
Strips all whitespace from an input string
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# | |
# Script to strip all whitespace characters from a string | |
input_string=$1 | |
trimmed_input_string="$(echo -e "${input_string}" | tr -d '[:space:]')" | |
echo "|${trimmed_input_string}|" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment