mpv:
When you execute a script it spawns a new shell, and shell variables defined in the child process are not automatically passed back to the parent. If your script is called myscript.ss and runs in ksh and sh, you need to use the dot operator:
. myscript.ss # space after the "."
This was covered extensively in this forum under thread:
thread822-255445
Regards,
Ed