sed not storing output in shell script

Hello,

Following my learning of shell scripting.. I got stuck yet again.
If I execute this command on terminal:

$ sed "s/off/on/g" file > fileAUX

I successfully change the text off to on from file to fileAUX.

But the same command is not working inside a shell script. I tested and sed does find the file and it DOES make the changes if I direct it to stdoutput (screen)

I tried running with sudo (I am using Ubuntu) with no success..

Any idea?

can you show your script

Hello,

I should have posted a response earlier, thanks itkmara for asking me to show the script. I was only thinking on that line and I did not realise the issue was the working path I was using.

The previous line WORKS in shell terminal and script