Replacing specifics of a line in a text file

I’ve a need to replace numericals on this below line which is embedded on a text file for bucket list of servers,

from aix;Team1;%/opt;80;90;95;
to aix;Team1;%/opt;75;85;95;

Could you please let know on this achievement? I could remember of using “sed” but unsure on how to escape special characters for above case. Your help would be greatly appreciated.

I would recommend getting this to work on the command line using something like sed or something similar, then impliment that with bigfix.

  • What OS do you need to do this for?
  • What command line tools are available?

This is for AIX and Linux

I haven’t tested this at all, but probably something like this:

sed -i 's/aix;Team1;%\/opt;80;90;95;/aix;Team1;%\/opt;75;85;95;/' input.txt

To do this with BigFix, it will probably need to be something like this:

wait bash -c "sed -i 's/aix;Team1;%\/opt;80;90;95;/aix;Team1;%\/opt;75;85;95;/' fullpathtoinput.txt"

Thank you so much, I’ll have this tested and let you know.

1 Like

just test it on the command line first, then test it through bigfix after.

Yes, that’s how I’ll proceed

1 Like