# environment setting instead of ln



## Beeblebrox (Feb 8, 2013)

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.


----------



## gordon@ (Feb 9, 2013)

This isn't something the shell can do.


----------



## wblock@ (Feb 9, 2013)

Well, it can't do it _well_... 


```
sed -e 's%/opt/%/usr/local/%g' old-bad-script > new-good-script
sh new-good-script
```


----------

