Skip to content

Instantly share code, notes, and snippets.

@mark-lumbao
Created March 7, 2022 13:26
Show Gist options
  • Save mark-lumbao/d15bd255745efa232831528623471f32 to your computer and use it in GitHub Desktop.
Save mark-lumbao/d15bd255745efa232831528623471f32 to your computer and use it in GitHub Desktop.
Short script for replacing string values
#!/bin/env bash
# Dependency: nodejs
input=$(cat /dev/stdin)
echo "console.log('$input'.replace('$1', '$2'))" | node
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment