environment setting instead of ln

When trying to compile linux software, I have found that there are some lines in the source script which are hard-coded to /opt. One way to deal with the problem is to create symlink:
# ln -s /usr/local /opt
I would prefer to set this in shell, but can't figure it out. How can I set environment variable to redirect any call for /opt to /usr/local (bash preferably)?
Thanks.
 
Well, it can't do it well... :)

Code:
sed -e 's%/opt/%/usr/local/%g' old-bad-script > new-good-script
sh new-good-script
 
Back
Top