Skip to content

Instantly share code, notes, and snippets.

@rhaist
Created May 26, 2015 12:09
Show Gist options
  • Save rhaist/83cf2d8090620b867c87 to your computer and use it in GitHub Desktop.
Save rhaist/83cf2d8090620b867c87 to your computer and use it in GitHub Desktop.
Bash on-liner to generate ASCII and WIDE strings from a file and show a sorted output
#!/bin/bash
(strings -a -td "$@" | sed 's/^\(\s*[0-9][0-9]*\) \(.*\)$/\1 A \2/' ; strings -a -td -el "$@" | sed 's/^\(\s*[0-9][0-9]*\) \(.*\)$/\1 W \2/') | sort -n
@Neo23x0
Copy link

Neo23x0 commented May 26, 2015

On OS X: use gstrings and gsed

port install binutils
port install gsed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment