Modifying file from command line using Perl

Hi all,

I am having a slight issue updating a file using perl from the command line I need some help with.

The item is:

DATA_FILE_TYPE=FULL

When I run the below command

/usr/bin/perl -p -i -e "s/DATA_FILE_TYPE=[FULL|UPDATE|DELETE]/DATA_FILE_TYPE=APPEND/g" processfile.cfg

It looks to be inserting the item instead of changing the value

DATA_FILE_TYPE=APPENDULL

I would like to change the value to one of the below from the command line.

FULL
APPEND
UPDATE
DELETE

I'm sure this must be something simple I am missing :slight_smile:

Use

(FULL|UPDATE|DELETE)

to define alternative strings, your example defines a character class.

great! That works. Thank you so much.