Last active
January 10, 2023 21:33
-
-
Save petergi/3590d852e4c7baad9d878d6947810ab1 to your computer and use it in GitHub Desktop.
This file contains 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 | |
hostname=$(HOSTNAME | sed 's/.local//g' | sed 's/.gateway//g' ) | |
# if hostname is >35 characters, truncates to make it fit on std. 80 window | |
if [ ${#HOSTNAME} -gt 35 ] | |
then | |
hostname=${HOSTNAME:0:35} | |
fi | |
echo $hostname |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment