kumarabhishek
kumarabhishek

Reputation: 125

Shell (tcsh) command to change the value corresponding to a key

What should be the Shell (tcsh) command if i want to change the value corresponding to the key in a properties file. For Example: Key=Value to Key=SomeOtherValue

Upvotes: 0

Views: 305

Answers (1)

jwismar
jwismar

Reputation: 12258

In tcsh (or csh, for that matter), you use the setenv command to write a value to an environment variable.

setenv Key SomeOtherValue

For more information take a look at any csh reference (because it's more widely used, and tcsh is completely compatible.)

For example, see here.


Update: OP has now clarified the the wants to edit the content of a properties file, not an environment variable.

Here is a good SO question/answer that solves this different problem nicely. It uses bash, but translating should be easy.

Changing contents of a file through shell script

Upvotes: 2

Related Questions