/build/static/layout/Breadcrumb_cap_w.png

Scripting Question


Using Kace to modify text within a file

07/27/2020 161 views

Does anybody use Kace to modify text within a file?  I would like to change some parameters in different configuration files in Mac and Windows and not have to reinstall the entire software. 

0 Comments   [ + ] Show comments

Comments


All Answers

0

Well, this is usually a relatively easy task. Check with the vendor how to do this via CLI (most vendors have a special tool for such things that the changes have been not only done in the config file but also used in the tool already.

If not the best way is to create the "new" text file and use a File Sync to bring it to the client systems (Distribution |File Sync)

If this is not an option it really depends on the OS.
if you want to replace aaa=bbb with aaa=xxx (usual thing in config files)
For Linux and Macos you would run something like 

sed -i "/aaa=bbb/c\aaa=xxx" config.conf
For Windows you would run something like       
 powershell -Command "(gc config.conf) -replace 'aaa=bbb', 'aaa=xxx' | Out-File config.conf"
Answered 07/27/2020 by: Nico_K
Red Belt

 
This website uses cookies. By continuing to use this site and/or clicking the "Accept" button you are providing consent Quest Software and its affiliates do NOT sell the Personal Data you provide to us either when you register on our websites or when you do business with us. For more information about our Privacy Policy and our data protection efforts, please visit GDPR-HQ