VideosMy ProjectsProgramming BlogGallery
  1. Home
  2. Blog
  3. Setting properties in a properites file using bash
Programming Blog

Atom/RSS Feed

bash

Setting properties in a properites file using bash

bash

To set or update properties in a properties file from a bash script you can use sed

Example SED usage

Given the properties file:

name=John
last=Wiseman

We can then run the command sed:

sed -i -e "s|REGEX|REPLACE|g" ./file

For Example

sed -i -e "s|name=.*|name=Sandtrooper|g" ./file

This will set every name property to Sandtrooper in ./file

Join my mailing list