Here is my code in ksh file
current_year=$(date +%Y)
current_month=$(date +%m)
sql=$(cat $script_path | sed -i 's/&1/current_year/g' | sed -i 's/&2/current_month/g')
Fisrt, I cat a sql file in KSH file and then I want the a string called "&1" and "&2" in sql file are replaced by current_year and current_month. But it doesn't work, hope I can find a solution here, thanks very much.
The reason I did that is I don't want to pass the parameter to sql file from ksh file, I just want a simple way to replace the string in ksh file.