09-17-2010
Quote:
Originally Posted by
john1212
I used "z" as "/" in s command s/REGEXP/REPLACEMENT/FLAGS
Hi.
I saw that. I was referring to the single quote at the end, and the extra / (which you have since removed).
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
I have been search all over the internet to find a solution to this.
I have a file that looks like:
-a ItemConfig.custom=true
-a Config.custom=true
go -t malu
-t Use=true
I want to get "malu" as output, and the werid thing is the blank before go is neither space nor tab.
what's the sed... (4 Replies)
Discussion started by: katrvu
4 Replies
2. Shell Programming and Scripting
Hi,
I have the following XML not well-indented code:
<hallo
>this is a line
</hallo>
So I need to remove the newline.
This syntax finds what I need to correct, but I don't know how to remove the newline after my pattern:
sed 's/<.*$/&/'
How can I subtract the newline after my... (1 Reply)
Discussion started by: nico.ben
1 Replies
3. Shell Programming and Scripting
Hi,
i want to remove a certain pattern when i type pwd.
pwd will look like this:
..../....../....../Pat_logs/..../....../...../......
the dotted lines are just random directory names,
i want it to remove the "Pat_logs/...../....../....../" part
so for example:
... (5 Replies)
Discussion started by: a27wang
5 Replies
4. UNIX for Dummies Questions & Answers
HI,
My input file contains below data:
DFHDR
12345110
1,200
2,-100
1,100
2,123
12345110
1,300
2,200
DFTLR
In the above data, the first line and last lines should be remove as well as the lines in which contains 110 as position(6,7,8 position) should also be removed,
How we... (0 Replies)
Discussion started by: pandeesh
0 Replies
5. Shell Programming and Scripting
<Update>
I have the solution:
sed 's/\{3\}/&;&;---;4/'
The thread can be marked as solved!
</Update>
Hi There,
I'm working on a script processing some data from a website into cvs format. There is only one final problem left I can't find a solution.
I've processed my file... (0 Replies)
Discussion started by: lolworlds
0 Replies
6. Shell Programming and Scripting
Hi,
I am trying to remove the caret symbol from a bash variable. This is the variable:
var="GOTAN^TOK^B"and this is the code I am trying to use to remove the caret symbol:
nocarrot=`echo $var | sed -e 's/^/_/g'`This is the output intended (but not acheived with the above function):... (3 Replies)
Discussion started by: goodbenito
3 Replies
7. UNIX for Dummies Questions & Answers
Hi,
Need help to extract a pattern using sed or cut or any other means.
Input
'name1',1234567890
'name2',2222222222
'name3',3333333333
Expected output
name1,1234567890
name2,2222222222
name3,3333333333 (3 Replies)
Discussion started by: mukulverma2408
3 Replies
8. UNIX for Dummies Questions & Answers
Hi again
I have an xml file and want to remove the leading white space as it causes me issues later in my script
I see sed is possible but cant seem to get it to work
I tried
sed 's/^ *//' file.xml
output
<xn:VsDataContainer id="1U104799" modifier="update">
... (10 Replies)
Discussion started by: aniquebmx
10 Replies
9. Shell Programming and Scripting
Hi,
I have file which contains following lines
A| 965.|Mr.|35.45| 66.
B| 33.| a456.| 77.
The output should be
A|965|Mr.|35.45|66
B|33| a456.|77
Basically if a Number has space in prefix and . in suffix remove both.
So pattern could be if there is a | which has next two characters as... (1 Reply)
Discussion started by: wahi80
1 Replies
10. Shell Programming and Scripting
Team,
I am trying to use sed to delete 15 lines, after pattern patch, which includes the pattern as well in Solaris. I used the below command, as we do it Linux, but it's not working as expected in Solaris.
I am getting the error as "garbled".sed '/\/table/,+15d' status.html
sed: command... (8 Replies)
Discussion started by: Nagaraj R
8 Replies
LEARN ABOUT OPENDARWIN
m4
M4(1) User Commands M4(1)
NAME
m4 - macro processor
SYNOPSIS
m4 [OPTION]... [FILE]...
DESCRIPTION
Process macros in FILEs. If no FILE or if FILE is `-', standard input is read.
Mandatory or optional arguments to long options are mandatory or optional for short options too.
Operation modes:
--help display this help and exit
--version
output version information and exit
-E, --fatal-warnings
once: warnings become errors, twice: stop execution at first error
-i, --interactive
unbuffer output, ignore interrupts
-P, --prefix-builtins
force a `m4_' prefix to all builtins
-Q, --quiet, --silent
suppress some warnings for builtins
--warn-macro-sequence[=REGEXP]
warn if macro definition matches REGEXP,
default $({[^}]*}|[0-9][0-9]+)
-W, --word-regexp=REGEXP
use REGEXP for macro name syntax
Preprocessor features:
-D, --define=NAME[=VALUE]
define NAME as having VALUE, or empty
-I, --include=DIRECTORY
append DIRECTORY to include path
-s, --synclines
generate `#line NUM "FILE"' lines
-U, --undefine=NAME
undefine NAME
Limits control:
-g, --gnu
override -G to re-enable GNU extensions
-G, --traditional
suppress all GNU extensions
-H, --hashsize=PRIME
set symbol lookup hash table size [509]
-L, --nesting-limit=NUMBER
change nesting limit, 0 for unlimited [0]
Frozen state files:
-F, --freeze-state=FILE
produce a frozen state on FILE at end
-R, --reload-state=FILE
reload a frozen state from FILE at start
Debugging:
-d, --debug[=FLAGS]
set debug level (no FLAGS implies `aeq')
--debugfile[=FILE]
redirect debug and trace output to FILE (default stderr, discard if empty string)
-l, --arglength=NUM
restrict macro tracing size
-t, --trace=NAME
trace NAME when it is defined
FLAGS is any of:
a show actual arguments
c show before collect, after collect and after call
e show expansion
f say current input file name
i show changes in input files
l say current input line number
p show results of path searches
q quote values as necessary, with a or e flag
t trace for all macro calls, not only traceon'ed
x add a unique macro call id, useful with c flag
V shorthand for all of the above flags
If defined, the environment variable `M4PATH' is a colon-separated list of directories included after any specified by `-I'.
Exit status is 0 for success, 1 for failure, 63 for frozen file version mismatch, or whatever value was passed to the m4exit macro.
AUTHOR
Written by Rene' Seindal.
REPORTING BUGS
Report bugs to: bug-m4@gnu.org
GNU M4 home page: <http://www.gnu.org/software/m4/>
General help using GNU software: <http://www.gnu.org/gethelp/>
COPYRIGHT
Copyright (C) 2016 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law.
SEE ALSO
The full documentation for m4 is maintained as a Texinfo manual. If the info and m4 programs are properly installed at your site, the com-
mand
info m4
should give you access to the complete manual.
GNU M4 1.4.18 December 2016 M4(1)