Re: How to run vi with nohup?



In comp.os.linux.misc AN O'Nymous <a_n_onymous80@xxxxxxxxxxx>:
Is it possible to edit a text file using vi without interactive
keyboard input?

E.g. let's say data.txt file from lines 1234 to 1237 contains:

3034 2.454295900E-01-1.647665100E-01-5.115002000E-02 0
0
3035 2.111312000E-01-9.416140600E-02-4.627781400E-02 0

[..]

I wan't to edit -1.133* to -1.500*

If I used the keyboard, I would type:
:%s/-1.133/-1.500

How do I do this automatically through the nohup command?

You don't need nohup.

vi file 2>/dev/null << EOF
:%s/-1.133/-1.500
:wq!
EOF

Or whatever you want.
[..]

Two other questions:
1) How do I edit -1.133 to say 0.5, whilst preserving the column
accounting? (so the decimal point goes in exactly the same spot, while
the text after 0.5 doesn't get shifted right).

Dunno what you mean. I'd suggest trying 'vimtutor' and trying a
google search, there are quite a few docs about basic vi(m)
usage.

2) The %s flag for replacing text searches the whole file. How do I
specifically search & replace between lines X and Y?

:1,50 s/-1.133/-1.500

To replace the first occurrence of your pattern in line 1 to 50.

BTW
Please, please try below URL(s) before answering, most people
aren't using a browser here to read/write, this is usenet.

http://www.safalra.com/special/googlegroupsreply
http://cfaj.freeshell.org/google

--
Michael Heiming (X-PGP-Sig > GPG-Key ID: EDD27B94)
mail: echo zvpunry@xxxxxxxxxx | perl -pe 'y/a-z/n-za-m/'
#bofh excuse 367: Webmasters kidnapped by evil cult.
.



Relevant Pages

  • Re: Search Words
    ... You can edit / control your personal information by doing the following; ... Click on the "Content" tab ... Click on the "AutoComplete" button ... when the first letter is entered into the google search box. ...
    (microsoft.public.windowsxp.basics)
  • [SLE] KDE 3.4 Arts FIX (Solved)
    ... I found this from a Google search: ... edit (as root) the file: ... For additional commands send e-mail to suse-linux-e-help@suse.com ...
    (SuSE)
  • Re: Pls. answer only if you know...
    ... LOL ... This is a peer support newsgroup and demands for support are not well ... BTW you should try his suggestion for the Google search. ... >>>Where is the, Edit Option, in a Works Word 7 Edition, ...
    (microsoft.public.windowsxp.general)
  • Re: Editing the registry on a different drive.
    ... I asked this very question on this very newsgroup not two weeks ago, ... A Google search might have picked it up, ... The problem is that I cannot boot into the verison of windows xp on my ... allow me to edit the registry on 'e:' and it would all work out. ...
    (microsoft.public.windowsxp.help_and_support)