# Do the inplace edit without backup file generated

**URL:** <https://www.ruby-forum.com/t/do-the-inplace-edit-without-backup-file-generated/179527>\
**Category:** Ruby\
**Created:** [November 27, 2009, 3:25am UTC](https://www.ruby-forum.com/t/do-the-inplace-edit-without-backup-file-generated/179527 "2009-11-27T03:25:55Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Hongyi\_Zhao](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/8baadc/32.png) [@Hongyi\_Zhao](https://www.ruby-forum.com/u/Hongyi_Zhao)\
**Post date:** [November 27, 2009, 3:25am UTC](https://www.ruby-forum.com/t/do-the-inplace-edit-without-backup-file-generated/179527/1 "2009-11-27T03:25:55Z")

</div>

Hi all,

Can I do the inplace edit without backup file generated by using ruby?

Best regards.

---

<div class="post-metadata">

**Author:** ![Hongyi\_Zhao](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/8baadc/32.png) [@Hongyi\_Zhao](https://www.ruby-forum.com/u/Hongyi_Zhao)\
**Post date:** [November 27, 2009, 8:20am UTC](https://www.ruby-forum.com/t/do-the-inplace-edit-without-backup-file-generated/179527/2 "2009-11-27T08:20:55Z")

</div>

On 11/27/2009 03:21 AM, Hongyi Zhao wrote:

> Hi all,
> 
> Can I do the inplace edit without backup file generated by using ruby?
> 
> Best regards.

Usage: ruby [switches] [–] [programfile] [arguments]  
-0[octal] specify record separator (\0, if no argument)  
-a autosplit mode with -n or -p (splits $\_ into $F)  
-c check syntax only  
-Cdirectory cd to directory, before executing your script  
-d set debugging flags (set $DEBUG to true)  
-e ‘command’ one line of script. Several -e’s allowed. Omit  
[programfile]  
-Eencoding specifies the character encoding for the program  
codes  
-Fpattern split() pattern for autosplit (-a)  
-i[extension] edit ARGV files in place (make backup if extension  
supplied)  
-Idirectory specify $LOAD\_PATH directory (may be used more than  
once)  
-l enable line ending processing  
-n assume ‘while gets(); … end’ loop around your  
script  
-p assume loop like -n but print line also like sed  
-rlibrary require the library, before executing your script  
-s enable some switch parsing for switches after script  
name  
-S look for the script using PATH environment variable  
-T[level] turn on tainting checks  
-v print version number, then turn on verbose mode  
-w turn warnings on for your script  
-W[level] set warning level; 0=silence, 1=medium, 2=verbose  
(default)  
-x[directory] strip off text before #!ruby line and perhaps cd to  
directory  
–copyright print the copyright  
–version print the version
