Skip to content

Instantly share code, notes, and snippets.

@alexjyong
Created March 11, 2022 17:04
Show Gist options
  • Save alexjyong/dab65a4c8920fe3f2485aefbf832285c to your computer and use it in GitHub Desktop.
Save alexjyong/dab65a4c8920fe3f2485aefbf832285c to your computer and use it in GitHub Desktop.
perl oneliner to filter CLI output
perl -wnE'say /<add a regex here>/g'
example: docker inspect --format='{{index .RepoDigests 0}}' superCoolTag | perl -wnE'say /sha256.*/g'
this would output only the sha256 of the image.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment