06-14-2013
This has the answer. Please check answer 2.
Unix Sed Tutorial : 7 Examples for Sed Hold and Pattern Buffer Operations (link removed)
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
I need to display a line in an xterm window but i want to revese the colors so that the background color becomes the foreground color and the foreground color the background color. I want to do this as part of ksh script.
Can somebody tell me how to do this ?
Thanks,
Abu. (5 Replies)
Discussion started by: marcose
5 Replies
2. IP Networking
I'm trying to create a reverse lookup file. Below are the error messages I get in the messages file, when I start named. Below the error messages is a copy of the reverse lookup file I'm trying to use. I'm using Bind version 8.1.2. Would someone recommend the correct values and if you see any... (2 Replies)
Discussion started by: Westy564
2 Replies
3. Shell Programming and Scripting
I a file with log entries... I want to sort it so that the last line in the file is first and the first line is last..
eg.
Sample file
1
h
a
f
8
6
After sort should look like
6
8
f
a
h
1 (11 Replies)
Discussion started by: frustrated1
11 Replies
4. Shell Programming and Scripting
I have to extract data from a text file which is huge in size >>10GB.
ie between two strings. If I do an ordinary sed it takes forever to come out. I was wondering if there was anyway to do the entire process in reverse and on finding the relevant string is there any way to break out of the... (5 Replies)
Discussion started by: scorreg
5 Replies
5. UNIX for Dummies Questions & Answers
I've got hundreds of lines in a file that looks like this:
Line1 CCR CCH
Line2 ICVM FBO GSC
Line3 MKF
The result should be like the one below so that I can insert them on our database.
Line1 CCR
Line1 CCH
Line2 ICVM
Line2 FBO
Line2 GSC
Line3 MKF
Thanks in advance! (4 Replies)
Discussion started by: The One
4 Replies
6. UNIX for Advanced & Expert Users
Hi Guys,
Am new to this forum .... And also to shell scripting
I need a k-shell script to reverse the contents of a file...
Please come up with the solutions...
With regards,
Anand (10 Replies)
Discussion started by: aajan
10 Replies
7. Shell Programming and Scripting
i am using AIX -ksh
how can i reverse any file ,i have already try tac cmd it is not in AIX:
please help me out. (3 Replies)
Discussion started by: RahulJoshi
3 Replies
8. Shell Programming and Scripting
Hi all
I am trying to numerically reverse sort a file but I seem to be having trouble.
Example of file contents:
text1,1
text2,-1
text3,0
I can sort using sort -k 2n -t, filename without any problems.
However I want my results in descending order but using -r in my command... (2 Replies)
Discussion started by: pxy2d1
2 Replies
9. Shell Programming and Scripting
HI all,
i have a file called monitor.cfg and have some sections,under these sections many parameter's are there.
like.....
MONITOR.CFG
p1
p2
p3
#comments
#comments
p4
p5
p6
eof.
i want to add some new parameters in section exactly at end of comments using sed.
Thanks
surya (4 Replies)
Discussion started by: suryanarayan
4 Replies
10. UNIX for Dummies Questions & Answers
Hi all,
I have a file named file1as
07/25 00:10 d327490
07/25 00:55 d378299
07/25 03:58 d378299
07/25 06:14 d642035
07/25 12:44 c997126
and now i want to reverse the first filed ie 07/25 as
25/07 00:10 d327490
25/07 00:55 d378299
25/07 03:58 d378299
25/07 06:14 d642035
25/07... (5 Replies)
Discussion started by: zozoo
5 Replies
LEARN ABOUT DEBIAN
shtool-subst
SHTOOL-SUBST.TMP(1) GNU Portable Shell Tool SHTOOL-SUBST.TMP(1)
NAME
shtool-subst - GNU shtool sed(1) substitution operations
SYNOPSIS
shtool subst [-v|--verbose] [-t|--trace] [-n|--nop] [-w|--warning] [-q|--quiet] [-s|--stealth] [-i|--interactive] [-b|--backup ext]
[-e|--exec cmd] [-f|--file cmd-file] [file] [file ...]
DESCRIPTION
This command applies one or more sed(1) substitution operations to stdin or any number of files.
OPTIONS
The following command line options are available.
-v, --verbose
Display some processing information.
-t, --trace
Enable the output of the essential shell commands which are executed.
-n, --nop
No operation mode. Actual execution of the essential shell commands which would be executed is suppressed.
-w, --warning
Show warning on substitution operation resulting in no content change on every file. The default is to show a warning on substitution
operations resulted in no content change on all files.
-q, --quiet
Suppress warning on substitution operation resulting in no content change.
-s, --stealth
Stealth operation. Preserve timestamp on file.
-i, --interactive
Enter interactive mode where the user has to approve each operation.
-b, --backup ext
Preserve backup of original file using file name extension ext. Default is to overwrite the original file.
-e, --exec cmd
Specify sed(1) command directly.
-f, --file cmd-file
Read sed(1) command from file.
EXAMPLE
# shell script
shtool subst -i -e 's;(c) ([0-9]*)-2000;(c) 1-2001;' *.[ch]
# RPM spec-file
%install
shtool subst -v -n
-e 's;^(prefix=).*;1 $RPM_BUILD_ROOT%{_prefix};g'
-e 's;^(sysconfdir=).*;1 $RPM_BUILD_ROOT%{_prefix}/etc;g'
`find . -name Makefile -print`
make install
HISTORY
The GNU shtool subst command was originally written by Ralf S. Engelschall <rse@engelschall.com> in 2001 for GNU shtool. It was prompted
by the need to have a uniform and convenient patching frontend to sed(1) operations in the OpenPKG package specifications.
SEE ALSO
shtool(1), sed(1).
18-Jul-2008 shtool 2.0.8 SHTOOL-SUBST.TMP(1)