[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

No members online now.

Forum statistics

Threads
474,432
Messages
2,571,682
Members
48,796
Latest member
Greg L.

Latest Threads

Top