# "OneLiner" - replacement

**URL:** <https://www.ruby-forum.com/t/oneliner-replacement/130117>\
**Category:** Ruby\
**Created:** [February 25, 2008, 3:55pm UTC](https://www.ruby-forum.com/t/oneliner-replacement/130117 "2008-02-25T15:55:40Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![caefer](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/e36b37/32.png) [@caefer](https://www.ruby-forum.com/u/caefer)\
**Post date:** [February 25, 2008, 3:55pm UTC](https://www.ruby-forum.com/t/oneliner-replacement/130117/1 "2008-02-25T15:55:40Z")

</div>

Hi,

i have some replacement’s and would like to use the “in place  
operator”.  
How is it possible doing more than one repalcement, i thought i read  
something  
to hang the gsub method one after another, but it dosn’t work!?

ruby -pi\*.bak -e ‘gsub(/VAR\_TYP/,“TYP”).gsub(/VAR\_FREQ/,“FREQ”)’  
file.dat

many thanks  
Christian
