Sponsored Content
Full Discussion: Easy ex editor command
Top Forums Shell Programming and Scripting Easy ex editor command Post 302337158 by prash184u on Thursday 23rd of July 2009 01:21:43 PM
Old 07-23-2009
my bad ...

it was (echo "g/THREAD #2/d"; echo 'wq') | ex -s temp_file.txt

cjcox ... I tired adding % in front of g it would not work...

methyl...Your poposal also does not delete the line if its the finst and only line in the file

Thanks to both of you for replying .... Please feel free to try on ur terminal as it is only one line file and one command ...
 

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

Easy question.. from a df -k command 205181344 = 200 gigs, right?

See topic. I always have problems with the easy conversions. bash-2.03$ df -k . Filesystem kbytes used avail capacity Mounted on /dev/vx/dsk/webtrend/webtrends2 364904448 205181344 158481976 57% /webtrends/production/wtm_wtx/datfiles pretty... (4 Replies)
Discussion started by: LordJezo
4 Replies

5. HP-UX

Easy one : command listing total memory

Hi, I have been searching for a command that lists the total amount of memory in the HP-UX doc but haven't found it yet. vmstat is not exactly what i want. Does the command exists on HP UX? :confused: :confused: :confused: :confused: :confused: (4 Replies)
Discussion started by: beginer
4 Replies

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

7. UNIX for Dummies Questions & Answers

Need help on installing an EASY to use and easy to install command line text editor

Hi again. Sorry if it seems like I'm spamming the boards a bit, but I figured I might as well ask all the questions I need answers to at once, and hopefully at least get some. I have installed Solaris 10 on a server. The default text editors are there (vi, ex, ed, maybe others, I know emacs is... (4 Replies)
Discussion started by: EugeneG
4 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. 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
Arch::TempFiles(3pm)					User Contributed Perl Documentation				      Arch::TempFiles(3pm)

NAME
Arch::TempFiles - help to manage temporary files/dirs SYNOPSIS
use Arch::TempFiles qw(temp_file_name temp_file temp_dir); # all will be removed automatically on the script completion my $file_name1 = temp_file(); my $file_name2 = temp_file_name("status"); my $dir_name = temp_dir("arch-tree"); use Arch::TempFiles; my $tmp = new Arch::TempFiles; $tmp->root($tmp->dir); my $file_name = $tmp->name; open OUT, ">$file_name"; close OUT; DESCRIPTION
This module deals with temporary file names. It is similar to File::Temp, but simplier and more focused. Also, File::Temp is relatively new and was not shipped with older perl versions. Both function interface and object oriented interface are supported. FUNCTIONS
/METHODS The following functions are available: temp_root, temp_name, temp_file_name, temp_dir_name, temp_file, temp_dir. The corresponding class methods are available too: root, name, file_name, dir_name, file, dir. temp_root [dir] $tmp->root [dir] Change or return the root of the temporary files and dirs. The default is either $ENV{TMP_DIR} or "/tmp". temp_name [label] $tmp->name [label] Return the unused temporary file name. The default file name is "/tmp/,,arch-XXXXXX" where XXXXXX is a random number. To change this name use "temp_root" and/or provide label that replaces "arch". Please note, that the operation of acquiring the file name using this function/method and actual creating of this file is not atomic. So you may need to call this method again if the creation is failed, for example if some other process created the same file in the middle. temp_file_name [label] $tmp->file_name [label] Like "temp_name", but stores the name in the file list that will be removed on the end (on object destruction). temp_dir_name [label] $tmp->dir_name [label] Like "temp_name", but stores the name in the dir list that will be removed on the end (on object destruction). temp_file [label] $tmp->file [label] Like "temp_file_name", but also creates the file. temp_dir [label] $tmp->dir [label] Like "temp_dir_name", but also creates the dir. BUGS
Awaiting for your reports. AUTHORS
Mikhael Goikhman (migo@homemail.com--Perl-GPL/arch-perl--devel). SEE ALSO
For a different interface, see File::Temp. perl v5.10.1 2005-04-22 Arch::TempFiles(3pm)
All times are GMT -4. The time now is 04:30 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy