In place edit mode activation?

Hello,

Does anybody knows if there is a way to activate the ‘in place edit
mode’ from within a Ruby script that would have the same effect as using
the -i option on the command line?

Thanks

Laurent

Laurent J. wrote:

Hello,

Does anybody knows if there is a way to activate the ‘in place edit
mode’ from within a Ruby script that would have the same effect as using
the -i option on the command line?

Use $-i="" :

[~/tmp] cat >foo
foo
[~/tmp] cat dash-i.rb
$-i=""
[~/tmp] ruby -r dash-i -p -e ‘$_.upcase!’ foo
[~/tmp] cat foo
FOO

HTH