Skip to content
Advertisement

Changing contents of a tsx file through shell script

I have a requirement to change the contents of config.tsx file that contains values like:

JavaScript

I want to change this content using a shell script and save the file. Changed content can look like:

JavaScript

How can I do this?

Advertisement

Answer

This should work:

JavaScript

The -i option will edit the file in place. If you first want to try the command to see if it works the way you want, use it without the -i. The output will be printed to stdout.

User contributions licensed under: CC BY-SA
7 People found this is helpful
Advertisement