简体   繁体   中英

Replace line in config file using bash script

I have a line as follows in varnish config file.

VARNISH_STORAGE="file,${VARNISH_STORAGE_FILE},${VARNISH_STORAGE_SIZE}"

I need to replace the whole line above with

VARNISH_STORAGE="malloc,${VARNISH_STORAGE_SIZE}"

I need to write a shell script for this. How can I achieve this using sed or should I use something else?

sed 's/file,${VARNISH_STORAGE_FILE}/malloc/' filename

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM