Hi and welcome to LQ.
I think the problem is when you actually put the path (eg. /home/user/etc/). It contains forward slashes (/).
You can either escape them with (\) or change the delimiter (/) to something else, eg.
Code:
sed -i "s|path/to/something|$way|" file
Pleas note that you don't need to redirect the output to another file when you use the -i flag (see the manual pages)
Additionally, it's recommended to use $(...) instead of backticks, as in:
Code:
way=$(zenity --file-selection)
hth