Guest User

Untitled

a guest
Jan 20th, 2019
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.27 KB | None | 0 0
  1. #!/bin/bash
  2. # produce dd/mm/yyyy date, other formats possible
  3. date=$(date +"%d/%m/%Y")
  4. # see https://stackoverflow.com/questions/407523/escape-a-string-for-a-sed-replace-pattern
  5. escaped_date=$(echo "$date" | sed 's/[/&]/\&/g')
  6. sed -i 's/$(date)/'"$escaped_date"'/g' "$*"
Add Comment
Please, Sign In to add comment