Sponsored Content
Top Forums Shell Programming and Scripting Help with regular command creation for editor vi Post 302998701 by rdrtx1 on Tuesday 6th of June 2017 09:29:32 AM
Old 06-06-2017
Code:
echo "dog-cat-mouse-horse-duck" | awk -F- '{$0=$3 OFS $2 OFS $1 OFS $5 OFS $4} 1' OFS=-

 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

vi editor - ex Command help

: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

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

3. 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

4. UNIX for Dummies Questions & Answers

Command to find out user creation date

Is there a Command to find out user creation date ? or any other possible ways to find the same. (6 Replies)
Discussion started by: Crazy_murli
6 Replies

5. 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

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. OS X (Apple)

How to get the file creation date with find command

Is it possible to find all files based on the date of creation? And if so, how? I've been looking at the find command but it seems that only modification times are used as an option. (1 Reply)
Discussion started by: Straitsfan
1 Replies

8. 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

9. Shell Programming and Scripting

File creation using awk and gsub command

I have input file 04000912|100:|||||]|101:||]|creDate:1451876825000|1441324800000:]|1444003200000:]|1446595200000:]|1449187200000:]|1451865600000:] I have to get output as below ID|Re_Date|Re_Value|Re_date 04000912|100|40.0|44 04000912|100|50.0|55 04000912|100|60.0|66... (4 Replies)
Discussion started by: shabeena
4 Replies

10. 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
ex(1)							      General Commands Manual							     ex(1)

Name
       ex, edit - text editor

Syntax
       ex [ - ] [ -v ] [ -x ] [ -t tag ] [ -r ] [ +command ] [ -l ] name...
       edit [ ex options ]

Description
       The  editor  is	the  root  of a family of editors: and The editor is a superset of with the most notable extension being a display-editing
       facility.  Display-based editing is the focus of

       The name argument indicates the files to be edited.

Options
       -    Suppresses all interactive-user feedback.  This option is useful in processing editor scripts in command files.

       -v   Equivalent to using rather than

       -t   Equivalent to an initial tag command, that is, editing the file containing the tag and positioning the editor at its definition.

       -r   Used to recover after an editor or system crash.  It recovers by retrieving the last saved version of the named file.  If no  file	is
	    specified, it displays a list of saved files.

       -R   Sets the read-only option at the start.

       +command
	    Indicates  that  the editor should begin by executing the specified command.  If the command is omitted, it defaults to $, positioning
	    the editor at the last line of the first file, initially.  Other useful commands here are scanning patterns of the form  +/pattern	or
	    line numbers.

       -l   Sets up for LISP.  That is, it sets the showmatch and lisp options.  The -x option is available only if the Encryption layered product
	    is installed.

       -x   Causes to prompt for a key. The key is used to encrypt and decrypt the contents of the file. If the file contents have been  encrypted
	    with one key, you must use the same key to decrypt them.

Restrictions
       The command causes all marks to be lost on lines changed and then restored if the marked lines were changed.

       The command does not clear the buffer modified condition.

       The z command prints a number of logical rather than physical lines.  More than a screenful of output may result if long lines are present.

       File input/output errors do not print a name if the command line minus sign (-) option is used.

       There is no easy way to do a single scan ignoring case.

       The editor does not warn you if you place text in named buffers and do not use it before exiting the editor.

       Null characters are discarded from input files, and cannot appear in output files.

Files
       /usr/lib/ex?.?recover	     recover command
       /usr/lib/ex?.?preserve	     preserve command
       /etc/termcap		terminal capabilities
       ~/.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), vi(1), termcap(5), environ(7)
       "Edit: A Tutorial" and the "Ex Reference Manual" in the
       Supplementary Documents, Volume 1: General User

																	     ex(1)
All times are GMT -4. The time now is 02:30 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy