hi all,
i've a file named "a.config" with the line
"CLUSTER_NAME[\t][\t]cluster1" by [\t] i mean tabs.
now i need to change the value cluster1 to someother value, say autocluster. The code which i wrote was :

cat a.config | sed 's/CLUSTER_NAME[\t][\t] [A-Za-z0-9]*/CLUSTER_NAME[\t][\t]autocluster/' > a.config.temp
mv a.config.temp a.config

but this doesn seem to work, any idea on how to do it.

thanks in advance.

The following should edit and save a.config and create a backup copy of the original named a.config.old

perl -pi.old -e 's/(CLUSTER_NAME\t\t)cluster1/$1autocluster/' a.config
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.