Sponsored Content
Top Forums UNIX for Dummies Questions & Answers Grep only line starting with.... Post 302836513 by RavinderSingh13 on Wednesday 24th of July 2013 10:04:16 AM
Old 07-24-2013
Hello,


Could you please try the following and let me know if this helps.


1st way:
Code:
 
$ cat grep_starting | grep '^1266*'

1266.1369866124 ::
1266.1304711286 ::
1266.333792515 ::
1266.54932671 ::
$


2nd Day:

Code:
 
$ awk '/^1266/' grep_starting

1266.1369866124 ::
1266.1304711286 ::
1266.333792515 ::
1266.54932671 ::
$



Kindly try same and let me know if you have any queries.



Thanks,
R. Singh
This User Gave Thanks to RavinderSingh13 For This Post:
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

how to delete text from line starting pattern1 up to line before pattern2?

My data is xml'ish (here is an excerpt) :- <bag name="mybag1" version="1.0"/> <contents id="coins"/> <bag name="mybag2" version="1.1"/> <contents id="clothes"/> <contents id="shoes"/> <bag name="mybag3" version="1.6"/> I want to delete line containing mybag2 and its subsequent... (5 Replies)
Discussion started by: repudi8or
5 Replies

2. Shell Programming and Scripting

Grep from a starting line till the end of the file

Hi Folks, I got to know from this forums on how to grep from a particular line say line 6 awk 'NR==6 {print;exit}' But how do i grep from line 6 till the end of the file or command output. Thanks, (3 Replies)
Discussion started by: Mr. Zer0
3 Replies

3. Shell Programming and Scripting

Grep starting from a specific position

Hello people, I'm scratch my head to find a solution to my problem, I'm absolutely sure this is very simple!!! :wall: I'm using the tcpdump to show on the screen in real time the UCP traffic: tcpdump -l -i bond1 -s 1514 -nntttt -A src or dst 192.168.1.5 and port 10000 | egrep "/51/"The output... (5 Replies)
Discussion started by: Lord Spectre
5 Replies

4. Shell Programming and Scripting

AWK/GREP: grep only lines starting with integer

I have an input file 12.4 1.72849432773174e+01 -7.74784188610632e+01 12.5 9.59432114416327e-01 -7.87018212757537e+01 15.6 5.20139995965960e-01 -5.61612429666624e+01 29.3 3.76696387248366e+00 -7.42896194101892e+01 32.1 1.86899877018077e+01 -7.56508762501408e+01 35 6.98857157014640e+00... (2 Replies)
Discussion started by: chrisjorg
2 Replies

5. Shell Programming and Scripting

How to print line starting with certain string together with its following line?

Dear all, How can I print line starting with certain string together with its following line. Example is as follows: Input file: @M01596:22:000000000-A7YH7:1:1101:16615:1070 2:N:0:1... (2 Replies)
Discussion started by: huiyee1
2 Replies

6. Shell Programming and Scripting

Grep command to ignore line starting with hyphen

Hi, I want to read a file line by line and exclude the lines that are beginning with special characters. The below code is working fine except when the line starts with hyphen (-) in the file. for TEST in `cat $FILE | grep -E -v '#|/+' | awk '{FS=":"}NF > 0{print $1}'` do . . done How... (4 Replies)
Discussion started by: Srinraj Rao
4 Replies

7. Shell Programming and Scripting

With script bash, read file line per line starting at the end

Hello, I'm works on Ubuntu server My goal : I would like to read file line per line, but i want to started at the end of file. Currently, I use instructions : while read line; do COMMAND done < /var/log/apache2/access.log But, the first line, i don't want this. The file is long... (5 Replies)
Discussion started by: Fuziion
5 Replies

8. UNIX for Dummies Questions & Answers

How to grep a line not starting with # from a file (there are two lines starting with # and normal)?

e.g. File name: File.txt cat File.txt Result: #INBOUND_QUEUE=FAQ1 INBOUND_QUEUE=FAQ2 I want to get the value for one which is not commented out. Thanks, (3 Replies)
Discussion started by: Tanu
3 Replies

9. UNIX for Beginners Questions & Answers

Grep file starting from pattern matching line

I have a file with a list of references towards the end and want to apply a grep for some string. text .... @unnumbered References @sp 1 @paragraphindent 0 2017. @strong{Chalenski, D.A.}; Wang, K.; Tatanova, Maria; Lopez, Jorge L.; Hatchell, P.; Dutta, P.; @strong{Small airgun... (1 Reply)
Discussion started by: kristinu
1 Replies

10. Shell Programming and Scripting

Remove new line starting with a numeric value and append it to the previous line

Hi, i have a file with multiple entries. After some tests with sed i managed to get the file output as follows: lsn=X-LINK-IN0,apc=661:0,state=avail,avail/links=1/1, 00,2110597,2094790,0,81,529,75649011,56435363, lsn=TM1ITP1-AM1ITP1-LS,apc=500:0,state=avail,avail/links=1/1,... (5 Replies)
Discussion started by: nms
5 Replies
xpacommon(7)							SAORD Documentation						      xpacommon(7)

NAME
XPACommon - Getting Common Information About Access Points SYNOPSIS
There are various kinds of generic information you can retrieve about an XPA access point by using the xpaget command. DESCRIPTION
You can find out which XPA access points have been registered with the currently running XPA name server by executing the xpaget command to retrieve info from the XPA name server: xpaget xpans If, for example, the stest test server program is running, the following XPA access points will be returned (the specifics of the returned info will vary for different machines and users): XPA xpa gs 838e2f67:1262 eric XPA xpa1 gs 838e2f67:1266 eric XPA c_xpa gs 838e2f67:1267 eric XPA i_xpa i 838e2f67:1268 eric Note that access to this information is subject to the usual XPA Access Control restrictions. Each XPA access point supports a number of reserved sub-commands that provide access to different kinds of information, e.g. the access control for that access point. These sub-commands can be executed by using xpaset or xpaget at the command line, or XPAGet() or XPASet() in programs, e.g: xpaget ds9 -acl xpaget ds9 -help xpaget ds9 env FOO xpaset -p ds9 env FOO foofoo With the exception of -help and -version, reserved sub-commands are available only on the machine on which the XPA server itself is run- ning. The following reserved sub-commands are defined for all access points: o -acl get (set) the access control list [options: host type acl, for set] The 'xpaset' option allows you to add a new acl for a given host, or change the acl for an existing host. See XPA Access Control for more information. This access point is available only on the server machine. o -env get (set) an environment variable [options: name (value, for set)] The 'xpaget' option will return the value of the named environment variable. The 'xpaset' option will set the value of the names vari- able to the specified value. This access point is available only on the server machine. (Please be advised that we have had problems setting environment variables in static Tcl/Tk programs such as ds9 running under Linux.) o -clipboard set(get) information on a named clipboard Clients can store ASCII state information on any number of named clipboards. Clipboards of the same name created by clients on differ- ent machines are kept separate. The syntax for creating a clipboard is: [data] | xpaset [server] -clipboard add|append [clipboard_name] xpaset -p [server] -clipboard delete [clipboard_name] Use "add" to create a new clipboard or replace the contents of an existing one. Use "append" to append to an existing clipboard. Information on a named clipboard is retrieved using: xpaget [server] -clipboard [clipboard_name] o -exec set: execute commands from buffer [options: none] If -exec is specified in the paramlist of an 'xpaset' call, then further sub-commands will be retrieved from the data buffer. o -help get: return help string for this XPA or sub-command [options: name (for sub-commands)] Each XPA access point and each XPA sub-command can have a help string associated with it that is specified when the access point is defined. The -help option will return this help string. For XPA access points that contain user-defined sub-commands, you can get the help string for a particular sub-command by specifying its name, or else get the help strings for all sub-commands if not name is specified. o -ltimeout get (set) the long timeout value [options: seconds|reset] The 'xpaget' option will return the value of the long timeout (in seconds). The 'xpaset' option will set the value of the long time- out. If "reset" is specified, then the timeout value will be reset to the default value. o -nsconnect set: re-establish name server connection to all XPA's [options: none] If the XPA Name Server (xpans) process has terminated unexpectedly and then re-started, this sub-command can be used to re-establish the connection. You use it by sending the command to the [name:port] or [file] of the access point instead of to the XPA name (since the latter requires the xpans connection!): xpaset -p 838e2f67:1268 -nsconnect See xpans for more information. o -nsdisconnect set: break name server connection to all XPA's [options: none] This sub-command will terminate the connection to the XPA Name Server (xpans), thereby making all access points inaccessible except through their underlying [name:port] or [file] identifiers. I forget why we added it, it seems pretty useless. o -stimeout get (set) the short timeout value [options: seconds|reset] The 'xpaget' option will return the value of the short timeout (in seconds). The 'xpaset' option will set the value of the short time- out. If "reset" is specified, then the timeout value will be reset to the default value. o -remote set: register xpa with remote server [options: host[:port] [acl]] [-proxy] This sub-command will register the XPA access point with the XPA name server (xpans) on the specified host (which must already be run- ning). The specified host also is given access control to the access point, using the specified acl or the default acl of "+" (meaning the remote host can xpaset, xpaget, xpainfo or xpaaccess). If the acl is specified as "-", then the access point is unregistered. See Communication Between Machines for more information on how this sub-command is used. o -version get: return XPA version string [options: none] The version refers to the version of XPA used to define this access point (currently something like 2.0). You can add your own reserved commands to all XPA access points by using the XPACmdAdd() routine, passing the XPA handle returned by XPA XPAGetReserved(void) as the first argument. Note again that these will only be available on the machine where the XPA service is running. SEE ALSO
See xpa(7) for a list of XPA help pages version 2.1.14 June 7, 2012 xpacommon(7)
All times are GMT -4. The time now is 05:44 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy