Sponsored Content
Full Discussion: vi editor - ex Command help
Top Forums UNIX for Dummies Questions & Answers vi editor - ex Command help Post 13548 by theDirtiest on Friday 18th of January 2002 03:34:32 PM
Old 01-18-2002
you guys are too fast. i was just about to say i found the 1,$. thanks again.
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

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. (2 Replies)
Discussion started by: tselvanin
2 Replies

2. UNIX for Dummies Questions & Answers

vim as command line editor

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

Search command on vi editor

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

Pasting text in VI editor from a different editor

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

set EDITOR=vi -> default editor not setting for cron tab

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

Easy ex editor command

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

Command to quit from vi editor

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

Insert charactera in 1st position of specific lines using vi editor or sed command

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

Accessing Isql command via VI editor

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

Help with regular command creation for editor vi

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
Command(3U)						    InterViews Reference Manual 					       Command(3U)

NAME
Command - base class for command objects SYNOPSIS
#include <Unidraw/Commands/command.h> DESCRIPTION
Command is an abstract base class for objects that define operations on components and other objects. Commands are similar to messages in traditional object-oriented systems in that components can receive and respond to them. Commands can also be executed in isolation to per- form arbitrary computation, and they can reverse the effects of such execution to support undo. Some commands (termed purely interpretive commands) are interpreted by components but never executed in isolation, some are executed but never interpreted (non-interpretive commands), and some are used in both ways. Some commands may be directly accessible to the user through menus, while others are internal to the application. In general, an undoable operation should be carried out by a command object. PUBLIC OPERATIONS
virtual void Execute() virtual void Unexecute() virtual boolean Reversible() Execute performs computation to carry out the command's semantics. Unexecute performs computation to reverse the effects of a pre- vious Execute, based on whatever internal state the command maintains. A command is responsible for maintaining enough state to reverse one Execute operation; repeated Unexecute operations will not undo the effects of more than one Execute. By default, Execute examines the current selection maintained in the command's editor (see below). Execute will do nothing if the nothing is selected and the command's clipboard (see below) is empty or non-existent. Otherwise, if something is selected and the command's clipboard is non-existent, then Execute creates a clipboard containing the selected component subjects. Finally, Execute will tell each component on the command's clipboard to interpret this. Conversely, Unexecute tells each component on the clipboard (if any) to Uninterpret this this. Thus, commands are purely interpretive by default. It may not be meaningful or appropriate, however, for some commands to reverse their effect. For example, it is probably not feasi- ble to undo a command that generates an external representation. The Reversible operation returns whether or not the command is unexecutable and uninterpretable. If the command is irreversible, then it is ignored during the undo process. By default, Reversible examines the command's clipboard; if the command doesn't have one, then the command is reversible if the user has at least one component view selected. If the command has a non-empty clipboard, then it is deemed reversible. Subclasses may redefine Reversible to base the command's reversibility on their own criteria. virtual void Store(Component*, Data* = nil) virtual Data* Recall(Component*) Since a command can affect more than one component, commands must let components that interpret them store undo information some- where. The commands must also let components recall the information during uninterpretation. Store lets a component store a Data object in the command itself as part of the component's interpretation process. The component can later retrieve the data with the Recall operation. Store and Recall require a Component argument to distinguish requests from potentially many components. virtual void Log() A convenience function for calling the equivalent function on the global unidraw object. virtual void SetControlInfo(ControlInfo*) virtual void SetEditor(Editor*) virtual void SetClipboard(Clipboard*) virtual ControlInfo* GetControlInfo() virtual Editor* GetEditor() virtual Clipboard* GetClipboard() Operations for setting and getting constructor-specified state stored in the command. Commands use a ControlInfo object to store information from which to build a user interface for executing the command. Commands keep a pointer to the Editor instance they potentially affect. Finally, a command uses a clipboard to store the components it affects or affected. A clipboard containing the components to be affected can be supplied in the constructor, but more often the command itself creates and primes a clipboard based on the editor's selected components. The Set... operations do not delete the object being replaced. virtual void First(Iterator&) virtual void Last(Iterator&) virtual void Next(Iterator&) virtual void Prev(Iterator&) virtual boolean Done(Iterator) Operations for iterating over the command's children, if any. These operations do nothing by default. Commands that compose other commands should redefine these operations to permit traversal of their children. First and Last initialize an iterator to point to the beginning and end of the list of children, respectively. Next increments the iterator to point to the following child, while Prev decrements the iterator to point to the preceding child. Done returns whether or not the iterator points beyond the first or last child in the list. virtual Component* Copy() Return a copy of the command. Subclasses should redefine this operation to return an instance of their type. virtual void Read(istream&) virtual void Write(ostream&) Read and write the command's contents to a stream to support catalog operations. Read and write typically call first the corre- sponding operations defined by their parent class, and then they read or write their class-specific state. Note that you must ensure that the objects are read in the same order they are written. virtual ClassId GetClassId() virtual boolean IsA(ClassId) GetClassId returns the unique class identifier for the Command subclass, while IsA returns whether the instance is of a class or subclass corresponding to the given identifier. IsA typically checks the given identifier against the instance's own (as defined by its GetClassId operation) and, failing that, calls its parent classes' IsA operation. All subclasses must redefine GetClassId and IsA to ensure that their identifiers are unique and that instances are written and read properly. virtual ClassId GetSubstId(const char*& delim) A Command subclasses can redefine GetSubstId to specify a command that can substitute for it. This lets applications that do not define a particular command subclass still read in a substitute that is compatible with the subclass. The substitute class should be one of the predefined commands in the Unidraw library. This guarantees that all applications can instantiate the substitute. GetSubstId returns the class identifier for the substitute. When an another Unidraw application's catalog reads this object, it can create an instance of the substitute (which it is guaranteed to define) instead of the original (which it may not define). The original should read and write a superset of the substitute's data. The catalog will read to the end of the substitute's data and then advance the stream to the point following the sequence of characters specified by delim, saving the extra characters between the two points in the stream. When the substitute object is saved subsequently, the original class identifier will be writ- ten along with the substitute's data plus the extra characters saved previously. Thus information needn't be lost as a result of being read and written by an unsophisticated application. PROTECTED OPERATIONS
Command(ControlInfo*, Clipboard* = nil) Command(Editor* = nil, Clipboard* = nil) The constructors are protected to prevent instatiation of the abstract base class. You can supply a ControlInfo or Editor and an optional clipboard. Only commands that will be accessible to the user need a ControlInfo object. All commands should be given an editor object before they are used. void InitCopy(Command*) ControlInfo* CopyControlInfo() Clipboard* CopyClipboard() Clipboard* DeepCopyClipboard() Convenience functions for use by subclasses in their Copy operation. InitCopy gives this a copy of the given command's editor, clipboard, and interpretation data stored by the components that interpreted it, if any. CopyControlInfo and CopyClipboard return copies of the command's ControlInfo and Clipboard objects, respectively, if they are non-nil. Both CopyControlInfo and CopyClip- board simply check for a nil argument before calling the corresponding Copy operations on the objects. DeepCopyClipboard checks for a nil clipboard before calling DeepCopy on the command's clipboard and returning the result. GraphicComp* GetGraphicComp() A convenience function that returns the GraphicComp in the editor that the command affects. SEE ALSO
Catalog(3U), Clipboard(3U), ControlInfo(3U), Data(3U), Editor(3U), GraphicComp(3U), Iterator(3U), Unidraw(3U), classes(3U), globals(3U), istream(3C++), ostream(3C++) Unidraw 23 January 1991 Command(3U)
All times are GMT -4. The time now is 07:10 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy