[Q] In place edit mode activation?

  • Thread starter Laurent Julliard
  • Start date
L

Laurent Julliard

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
 
J

Joel VanderWerf

Laurent said:
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,902
Latest member
Elena68X5

Latest Threads

Top