Skip to content

Instantly share code, notes, and snippets.

@jakub-g
Created April 20, 2020 08:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jakub-g/b489ff59a92198b9b5a83f78d7d89e34 to your computer and use it in GitHub Desktop.
Save jakub-g/b489ff59a92198b9b5a83f78d7d89e34 to your computer and use it in GitHub Desktop.
Use nodejs in bash script for string manipulation
$ echo "FOO_BAR" | node -p 'require("fs").readFileSync(process.stdin.fd, "utf-8").replace("_", "..")'
FOO..BAR
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment