khufford
04-29-2004, 12:43 PM
newbie needs help
I am trying to replace the previous month and year with the current month and year in a text file. IE March_2004 would change to April_2004. In my bash script I have this line but can't get it to work.
perl -pi -e "s/$(date +%B"_"%Y --date=('last month')/`$(date +%B"_"%Y))/g;" /root/CGP/mysql-create-table.sql
probably a syntax problem or incorrect use of date feature but still haven't come close. Any help would be greatly appreciated
I am trying to replace the previous month and year with the current month and year in a text file. IE March_2004 would change to April_2004. In my bash script I have this line but can't get it to work.
perl -pi -e "s/$(date +%B"_"%Y --date=('last month')/`$(date +%B"_"%Y))/g;" /root/CGP/mysql-create-table.sql
probably a syntax problem or incorrect use of date feature but still haven't come close. Any help would be greatly appreciated