I am working on some kind of version control for a specific software (Bash script.) When a new version releases, the code should be updated to the latest release, I have figured this out but I seem stuck and can't make the replacement inline.
#First we download the source code with wget, it returns a text with the new code
wget www.example.com/sourcecode | cat . > $0
How can I redirect that output (text / script) to the current script who's executing it and replace it.
Note $0 gives us the location of the current script. So the cat command, just should replace the new text coming from wget to the current script.
Thanks!