I have a file with the following line(s):
12/25/18,ALGT,01748X102,ALLEGIANT TRAVL,US,Upgrade,Buy
12/25/18,ALLE,G0176J109,ALLEGION PLC ,US,Downgrade,Sell
12/25/18,AMSF,03071H100,AMERISAFE INC ,US,Downgrade,Hold
And so on. I want to replace the first 8 characters with another value. So, the 12/25/18 is in a variable, and the replacement is in another variable.
No matter what I try, I cannot get the replacement to work. Either I get an error, or it does nothing. I've tried about 30 different syntaxes:
sed -i "s/${mmddyy}/${string}/g" $file
Can anyone help?