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