sort of common question but couldn't find a solution around.
I have a source file (python) with:
MYVARIABLE = 123
OTHERVAR = 23
print str(MYVARIABLE)
I want to modify the file by changing the value of MYVARIABLE to 456 from a remote terminal, without recurring to text editing, just a commandline oneliner.
I guess sed could do the job by looking for the first line where MYVARIABLE occurs, deleting everything and replacing with MYVARIABLE = 456
Not sure how this could be done, though. Inputs?