Skip to content

Instantly share code, notes, and snippets.

@Roninkoi
Last active February 28, 2023 21:33
Show Gist options
  • Select an option

  • Save Roninkoi/9fe8bdd724b376c936202a1144a798c5 to your computer and use it in GitHub Desktop.

Select an option

Save Roninkoi/9fe8bdd724b376c936202a1144a798c5 to your computer and use it in GitHub Desktop.
Write hexadecimal byte contents to multiple files. The file files.txt has rows in the format <filename> <hexadecimal number ffff...>
#!/bin/sh
##xargs -a files.txt -n2 sh -c '(echo "16i $(echo $1 | tr '[:lower:]' '[:upper:]') P" | dc) > $0'
xargs -a files.txt -n2 sh -c 'echo $1 | xxd -r -p - $0'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment