I have a file that contains:
<?php return 0;
I want to replace in bash, the value 0
by the current timestamp.
I know I can get the current timestamp with:
date +%s
And I can replace strings with sed
:
sed 's/old/new/g' input.txt > output.txt
But how to combine the two to achieve what I want? Solutions not involving sed
and date
are welcome as well, as long as they only use shell tools.