Skip to content

Instantly share code, notes, and snippets.

@Neo23x0
Last active August 13, 2021 13:56
Show Gist options
  • Star 14 You must be signed in to star a gist
  • Fork 5 You must be signed in to fork a gist
  • Save Neo23x0/cd4934a06a616ecf6cf44e36f323e551 to your computer and use it in GitHub Desktop.
Save Neo23x0/cd4934a06a616ecf6cf44e36f323e551 to your computer and use it in GitHub Desktop.
String Extraction / ASCII and Wide by @RobertHaist
Linux
(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
macOS
(gstrings -a -td "$@" | gsed 's/^\(\s*[0-9][0-9]*\) \(.*\)$/\1 A \2/' ; gstrings -a -td -el "$@" | gsed 's/^\(\s*[0-9][0-9]*\) \(.*\)$/\1 W \2/') | sort -n
@Neo23x0
Copy link
Author

Neo23x0 commented Jan 17, 2019

Add it like:
sudo vi /usr/local/bin/stringex

#!/bin/bash

...

chmod +x /usr/local/bin/stringex

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