03-26-2005
Quote:
Originally Posted by Kelam_Magnus
yea, I was just showing all known uses....
grep <pattern> file.in | sed 's/John/Mark/g' > file.out
That will filter out other lines in file.in ; Right ??
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
I know in vi you can do
:%s/replaceme/withthis/
but if i want to find all lines say without a # at the begining and I want to put it in how would that command be formatted? I can't figure it out for the life of me.
#comment
blah1
hey1
grrr1
#comment
#blah1
#hey1
#grrr1 (5 Replies)
Discussion started by: kingdbag
5 Replies
2. UNIX for Dummies Questions & Answers
How to write perl substitute command in shell script without invoking a perl script file seperately.
for ex:
shell script to relace IT with CSC in a file using perl substitute command. (3 Replies)
Discussion started by: param_it
3 Replies
3. Shell Programming and Scripting
Hi,
I have query terms like this:
a) apple bannana
b) apple bannana AND chickko
c) "milk shake" OR Graphes orange
whereever there is space substitue with AND operator.
I tried like this: (2 Replies)
Discussion started by: vanitham
2 Replies
4. Shell Programming and Scripting
My question is how would I substitute for ceratain number of occurences in a line? If this is my input
rjohns BFSTDBS01 Standard Silver NPRO30DINCR 2 Client
Is it possible to change the first 3 occurences of space " " to a comma? (7 Replies)
Discussion started by: reggiej
7 Replies
5. Shell Programming and Scripting
Hi
I'm trying to substitute word "January" with word "March" in my script but in certain lines only.
I have couple words containing pattern that I want to substitute e.g.
- log.January.1.array
- log_January_1_array_1
- log.January.1.array
- log_January_1_array_11
Trying to do cmd below... (9 Replies)
Discussion started by: presul
9 Replies
6. Shell Programming and Scripting
Hi,,
Let example cmd: $$config/all
Here I want to replace or subsitute blank space and also with any other character in place of "$" sign...and also want to replace backslash (/) with forward (\)......in expect script
please could any one help on this.....thank you (2 Replies)
Discussion started by: swethakast
2 Replies
7. UNIX for Dummies Questions & Answers
Hi there,
i am updating a file on UNIX and have many lines as per below :
listen:x:37:4:Network Admin:/usr/net/nls:
i would like to substitute from the :/usr to the end of the line.
so at the moment im using this :
:s/"\/$/ /g
but i get an error.can anyone help?
thank you (3 Replies)
Discussion started by: brian112
3 Replies
8. Shell Programming and Scripting
I am trying to do what I thought should be a simple substitution, but I can't get it to work.
File:
Desire output:
I thought I'd start with a sed command to remove the part of the header line preceding the string "comp", then go on to remove the suffix of the target string (e.g. ":3-509(-)"),... (3 Replies)
Discussion started by: pathunkathunk
3 Replies
9. Shell Programming and Scripting
Hi All,
I am trying to substitute a line in my existing file with the set of lines from another file. Regarding the existing file, i am sure that the line i am substituting will occur only at one place.
I have stored the text to be replaced in another file.
I am using below command.
cat... (7 Replies)
Discussion started by: chpsam
7 Replies
10. Shell Programming and Scripting
HI
I am trying to use the following code in the shell script (using grep)
usage()
{
echo "Usage: ./$0 <file name> <interval> <pattern>"
}
METRICS_FILE=$1
INTERVAL=$2
PATTERN="$3"
..
if
then
PATTERN="grep Gx"
fi
COUNT=`cat ${METRICS_FILE} | "${PATTERN}" |egrep... (8 Replies)
Discussion started by: asifansari
8 Replies
LEARN ABOUT DEBIAN
fsaparse
fsaparse(3gv) fsaparse(3gv)
NAME
fsaparse - parse a word-acceptor automaton file
SYNOPSIS
#include "wa.h"
fsafparse(fp, fsa)
FILE *fp;
Fsa *fsa;
DESCRIPTION
fsafparse parses a word-acceptor automaton file in the format described by DEAGL ("Data Exchange for Automata and Groups Language") (but
see the BUGS section below). fp should be a pointer to an open file containing the automaton. fsa should be a pointer to an Fsa struture
as defined in "fsa.h". Upon return, the automaton will have been written into this structure.
RETURN VALUES
On success, fsafparse() returns 1. On failure, it returns 0.
SEE ALSO
getwordlist(3), getmatlist(3), fgetmatlist(3),
getmatlist(1), automata(1)
BUGS
fsafparse is meant specifically for use with getwordlist(3) and getmatlist(3). It does not recognize the full language described by DEAGL.
It only recognizes that part of it which was present in the word-acceptor files that I was working with when I wrote it. I think this may
be sufficient for all word-acceptor automata, but I am not sure of this. Please let me know if you find word-acceptor files for which this
doesn't work.
AUTHOR
Mark Phillips
The Geometry Center
Sat Mar 23 22:01:32 1991 fsaparse(3gv)