Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save hxmuller/0c33c0cf59eb7752eee529eceb4e501b to your computer and use it in GitHub Desktop.
Save hxmuller/0c33c0cf59eb7752eee529eceb4e501b to your computer and use it in GitHub Desktop.
create vcgencmd command list from Raspberry Pi
# This creates a sorted single column list of commands which can be used with
# vcgencmd.
# The output of vcgencmd commands is a single variable with commands separated
# by commas.
#
# The cut command treats everything within the quotations as a single field and
# prints that.
#
# The awk command is instructed to use ', ' as a record separator, then prints
# each record.
#
# The sort command, does just that.
#
# The sed command deletes empty lines. For some reason awk creates an empty line
# when it produces it's output.
vcgencmd commands | cut -f2 -d\" | awk '{ print $0 }' RS=', ' | sort | sed '/^$/d'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment