12-29-2008
i have used the following code previously,
less a.dat | grep ".[0-9][0-9][0-9]0000..." > x.dat
which had worked very well previously but now need to take line number into consideration. is there a command similar to this?
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
Ok heres the situation.
I'm grepping for all running processes with the name system. but there are also processes running with the name systema. How do I just search for processes running just under the "system" user
Thanks in advance (1 Reply)
Discussion started by: fusion99
1 Replies
2. Shell Programming and Scripting
Having problem in using the grep command to select all possible combinations a number in a file. Example: 123, I would like to grep the numbers 123,132,213,231,312 and 321. (2 Replies)
Discussion started by: wperry
2 Replies
3. Shell Programming and Scripting
I have a pattern::
xldn3176bap>arj SOCRATES_MAIN_LNX | grep " FA "
10/04/2007 21:01 10/04/2007 21:01 FA 1776752/1 1
I want the line above this line and the line below it too. Can anyone tell me how it can be done?
- iAm4Free (4 Replies)
Discussion started by: iAm4Free
4 Replies
4. Shell Programming and Scripting
I've got a file which I am reading line by line (using read line) into a variable.
I then want to do a grep on that line to check for something. I've tried a number of methods none of which seem to work.
I thought I had it with the code below but for some reason it doesn't like it and comes... (4 Replies)
Discussion started by: QueryMaster
4 Replies
5. Shell Programming and Scripting
Hi,
I have a huge file & I want to add a specific text in column. But I want to add this text from a specific line number to a specific line number & another text in to another range of line numbers.
To be more specific: lets say my file has 1000 lines & 4 Columns. I want to add text "Hello"... (2 Replies)
Discussion started by: Ezy
2 Replies
6. UNIX for Dummies Questions & Answers
How do you grep every nth line number from a file? (2 Replies)
Discussion started by: shabs1985
2 Replies
7. Shell Programming and Scripting
I've got this command that I've been using to find strings on the same line, say I'm doing a search for name:
find . -name "*" | xargs grep -i "Doe" | grep -i "John" > output.txt
This gives me every line in a file that has John and Doe in it. I'm looking to add a OR operator for the second... (5 Replies)
Discussion started by: Rally_Point
5 Replies
8. Shell Programming and Scripting
Hi,
I need a regular expression grepping all lines starting with '*' followed by a VARIOUS number of blanks and then followed by the string 'Runjob=1'.
I tried that code, but it doesn't work:
grep -i '*'+'Runjob=1' INPUT_FILE >>OUTPUT_FILE
Can someone help me?
Thanks (8 Replies)
Discussion started by: ABE2202
8 Replies
9. Shell Programming and Scripting
I want to grep out a part of a snort rule based on the SID given, but all i want as the output is the part in the quotes after the msg: An example line looks something like this:
alert tcp any any -> 127.0.0.1 any (msg:"Example Message"; classtype:Example; sid:123456;)
I would want it to... (7 Replies)
Discussion started by: riott
7 Replies
10. UNIX for Dummies Questions & Answers
Hello Everyone.
I am trying to display contains of a file from a specific line to a specific line(let say, from line number 3 to line number 5). For this I got the shell script as shown below:
if ; then
if ; then
tail +$1 $3 | head -n $2
else
... (5 Replies)
Discussion started by: grc
5 Replies
rpc(5) File Formats Manual rpc(5)
NAME
rpc - rpc program number database
SYNOPSIS
/etc/rpc
DESCRIPTION
The rpc file contains user readable names that can be used in place of rpc program numbers. Each line has the following information:
name of server for the rpc program
rpc program number
aliases
Items are separated by any number of blanks and/or tab characters. A "#" indicates the beginning of a comment; characters up to the end of
the line are not interpreted by routines which search the file.
Here is an example of the /etc/rpc file from the SunOS System.
# # rpc 1.10 87/04/10 # portmapper 100000 portmap sunrpc rstatd 100001 rstat rup perfmeter rusersd 100002 rusers
nfs 100003 nfsprog ypserv 100004 ypprog mountd 100005 mount showmount ypbind 100007 walld
100008 rwall shutdown yppasswdd 100009 yppasswd etherstatd 100010 etherstat rquotad 100011 rquotaprog quota rquota
sprayd 100012 spray 3270_mapper 100013 rje_mapper 100014 selection_svc 100015 selnsvc database_svc 100016 rexd
100017 rex alis 100018 sched 100019 llockmgr 100020 nlockmgr 100021 x25.inr 100022 statmon
100023 status 100024 bootparam 100026 ypupdated 100028 ypupdate keyserv 100029 keyserver
FILES
/etc/rpc
SEE ALSO
getrpcent(3)
rpc(5)