Skip to content

Instantly share code, notes, and snippets.

@chadmayfield
Created January 8, 2018 05:28
Show Gist options
  • Save chadmayfield/ee3df274d6c98fd8f35514b91a46a647 to your computer and use it in GitHub Desktop.
Save chadmayfield/ee3df274d6c98fd8f35514b91a46a647 to your computer and use it in GitHub Desktop.
Using printf for fun with formatting
#!/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