I have been bashing my head against the wall trying to get sed to search a file are replace a timestamp.
example replace strings (file):
<script src="<@ofbizContentUrl>/xxx/js/v6/jsfile.js?v=201711271300</@ofbizContentUrl>"></script>
<script src="<@ofbizContentUrl>/xxx/js/v6/jsfile2.js?v=20171127245</@ofbizContentUrl>"></script>
basically I want to replace the 201711271300 in the examples with the current timestamp which i have saved in a variable date. The dates in the example differ from case to case.
I've been trying
sudo sed -i "s/?v=.+?(?=<)/?v=${date}/g" file
to no avail, going on 2 hours now
ancient sed?seddoesn't support lookahead regex