PDA

View Full Version : perl date problem


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

gold_dragon
05-01-2004, 04:34 AM
Why don't you use sql CUR_DATE()? If you can't get it all on one line, then why don't you make a perl file script? Sorry, it is just that this is bugging me about if you are trying to search and replace the mysql table. Or did you fix the problem already?