Re: How to run vi with nohup?
- From: Michael Heiming <michael+USENET@xxxxxxxxxxxxxx>
- Date: Sat, 18 Feb 2006 14:53:32 +0100
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.
.
- Follow-Ups:
- Re: How to run vi with nohup?
- From: AN O'Nymous
- Re: How to run vi with nohup?
- References:
- How to run vi with nohup?
- From: AN O'Nymous
- How to run vi with nohup?
- Prev by Date: Re: Changing hard drives and GRUB
- Next by Date: Re: urgent!!!thanks
- Previous by thread: How to run vi with nohup?
- Next by thread: Re: How to run vi with nohup?
- Index(es):
Relevant Pages
|