09-25-2003
editor command
I want to copy lines say from 2-5 to line after 20 in vi editor. Can I achieve this in a single command in vi editor.
Thanks.
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
:1,10 s/yes/no/g
this ex command will substitute yes with no everytime it is found within the first 10 lines of the file.
:s/yes/no/g
this ex command will substitute yes with no everytime it is found for the line where the cursor is on
my question is how could this substitution be... (4 Replies)
Discussion started by: theDirtiest
4 Replies
2. UNIX for Dummies Questions & Answers
Here is my problem,
I manage a SunOs 5.8 Server, vi is the default command line
editor, I have a line on each users .kshrc profile as follows:
export EDITOR=/bin/vi
I want to use vim as the command line editor, the below line
doesn't work
export EDITOR=/bin/vim
Thank you (1 Reply)
Discussion started by: tony3101
1 Replies
3. UNIX for Dummies Questions & Answers
Hi all,
Here is an example, I would wan to search for all string consists of IMP but not IMP-00015. Values other than 00015 is fine, is there anyone knows how to do that?
Thanks. (2 Replies)
Discussion started by: *Jess*
2 Replies
4. UNIX for Dummies Questions & Answers
Hi,
I knw its a silly question, but am a newbie to 'vi' editor. I'm forced to use this, hence kindly help me with this question.
How can i paste a chunk 'copied from' a different editor(gedit) in 'vi editor'?
As i see, p & P options does work only within 'vi'. (10 Replies)
Discussion started by: harishmitty
10 Replies
5. Shell Programming and Scripting
Hi All,
I am running a script , working very fine on cmd prompt. The problem is that when I open do crontab -e even after setting editor to vi by
set EDITOR=vi it does not open a vi editor , rather it do as below.....
/////////////////////////////////////////////////////
$ set... (6 Replies)
Discussion started by: aarora_98
6 Replies
6. Shell Programming and Scripting
I've this command in a script which edits the file ...
bash$ cat temp_file.txt
THREAD #2 2 Running
bash$ (echo "s/THREAD #2/d"; echo 'wq') | ex -s temp_file.txt
bash$ cat temp_file.txt
THREAD #2 2 Running
If i've more than 1 line it easily deletes the line, but if it is the last line... (3 Replies)
Discussion started by: prash184u
3 Replies
7. UNIX for Dummies Questions & Answers
Hi Folks
I have opened a log file in Vi editor
vi abc.logPlease advise me how to finally quit from Vi editor, which command is there..!
Is it :q<Enter> (1 Reply)
Discussion started by: KAREENA18
1 Replies
8. Shell Programming and Scripting
Dear all,
i am having text file like below
surya
rama
ranga
laxman
rajesh
reddy
i want add string (OK) before a text from line 3 to 5
the result will be
surya
rama
OK ranga
OK laxman
OK rajesh
reddy (1 Reply)
Discussion started by: suryanarayana
1 Replies
9. UNIX for Beginners Questions & Answers
Hi Guru's,
I'm new at Unix. I am tasked to monitor the filesystem utilization on OS level (Unix) and DB (Sybase) for multiple systems. I am thinking to use vi editor and make a file, execute that file and all the file systems I need to monitor will be be shown.
My script inside vi goes in... (8 Replies)
Discussion started by: Xworks
8 Replies
10. Shell Programming and Scripting
Hi, I need help.
I need to build command for line command editor vi. I want to take the whole string and assemble it in a regular expression. He then folded into another shape.
Can anyone help me? (4 Replies)
Discussion started by: Pabloss
4 Replies
EX(1) General Commands Manual EX(1)
NAME
ex, edit - text editor
SYNOPSIS
ex [ - ] [ -v ] [ -t tag ] [ -r ] [ +command ] [ -l ] name ...
edit [ ex options ]
DESCRIPTION
Ex is the root of a family of editors: edit, ex and vi. Ex is a superset of ed, with the most notable extension being a display editing
facility. Display based editing is the focus of vi.
If you have not used ed, or are a casual user, you will find that the editor edit is convenient for you. It avoids some of the complexi-
ties of ex used mostly by systems programmers and persons very familiar with ed.
If you have a CRT terminal, you may wish to use a display based editor; in this case see vi(1), which is a command which focuses on the
display editing portion of ex.
DOCUMENTATION
The document Edit: A tutorial (USD:14) provides a comprehensive introduction to edit assuming no previous knowledge of computers or the
UNIX system.
The Ex Reference Manual - Version 3.7 (USD:16) is a comprehensive and complete manual for the command mode features of ex, but you cannot
learn to use the editor by reading it. For an introduction to more advanced forms of editing using the command mode of ex see the editing
documents written by Brian Kernighan for the editor ed; the material in the introductory and advanced documents works also with ex.
An Introduction to Display Editing with Vi (USD:15) introduces the display editor vi and provides reference material on vi. In addition,
the Vi Quick Reference card summarizes the commands of vi in a useful, functional way, and is useful with the Introduction.
FILES
/usr/share/misc/exstrings error messages
/usr/libexec/exrecover recover command
/usr/sbin/expreserve preserve command
/etc/termcap describes capabilities of terminals
~/.exrc editor startup file
/tmp/Exnnnnn editor temporary
/tmp/Rxnnnnn named buffer temporary
/usr/preserve preservation directory
SEE ALSO
awk(1), ed(1), grep(1), sed(1), grep(1), vi(1), termcap(5), environ(7)
AUTHOR
Originally written by William Joy
Mark Horton has maintained the editor since version 2.7, adding macros, support for many unusual terminals, and other features such as word
abbreviation mode.
BUGS
The undo command causes all marks to be lost on lines changed and then restored if the marked lines were changed.
Undo never clears the buffer modified condition.
The z command prints a number of logical rather than physical lines. More than a screen full of output may result if long lines are
present.
File input/output errors don't print a name if the command line `-' option is used.
There is no easy way to do a single scan ignoring case.
The editor does not warn if text is placed in named buffers and not used before exiting the editor.
Null characters are discarded in input files, and cannot appear in resultant files.
4th Berkeley Distribution October 21, 1996 EX(1)