Created
January 8, 2018 05:28
-
-
Save chadmayfield/ee3df274d6c98fd8f35514b91a46a647 to your computer and use it in GitHub Desktop.
Using printf for fun with formatting
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 | |
flags=$(grep '^flags' /proc/cpuinfo | uniq | awk -F ": " '{print $2}') | |
printf "%-20s %s" "Flags:" | |
echo "$flags" | fold -s -w 40 | sed -e "2,\$s/^/$(echo $'\t' | pr -Te21)/" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment