Sponsored Content
Top Forums Shell Programming and Scripting Check for more than one expression using AWK Post 302289168 by agn on Thursday 19th of February 2009 01:38:45 AM
Old 02-19-2009
Try this:
Code:
$ cat buf1
AB
BC
CD
DE
$ echo -e 'AB\nBC\nCD\n' | cmp -s - buf1 && echo 'Y'
$ echo -e 'AB\nBC\nCD\nDE' | cmp -s - buf1 && echo 'Y'
Y

 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

filename extension check - regular expression

How to compare the file name for "zip" or "ZIP" extension. I can put one more || condition to check the upper case in the below: if ]; then Is there any better way to compare using regular expressions. Thx in advance. (4 Replies)
Discussion started by: devs
4 Replies

2. UNIX for Dummies Questions & Answers

regular expression and awk

I can print a line with an expression using this: awk '/regex/' I can print the line immediately before an expression using this: awk '/regex/{print x};{x=$0}' How do I print the line immediately before and then the line with the expression? (2 Replies)
Discussion started by: nickg
2 Replies

3. UNIX for Dummies Questions & Answers

Awk inside Awk expression

Hi, It can be used awk inside other Awk?. I need to get another text processing while other text process. Thank you. (2 Replies)
Discussion started by: pepeli30
2 Replies

4. Programming

Perl regular expression to check string ending

Hi, I am trying to write a regular expression in perl to check if the string end's with "numbers-numbers" or "-numbers". I experimented something like m/\d*-\d*$/ , but this is not solving my problem. Can anyone help me in writing this expression? Well spelled titles and proper use of code... (2 Replies)
Discussion started by: successlin
2 Replies

5. Shell Programming and Scripting

awk reg expression

Hello, I have thousand of messages (HL7), I want to use awk to extract only the ones that have a particular value in pv1.18 Each record in the file is the whole HL7 message, ie. when I print $0 I get the whole message MSH EVN PID etc. ,there is an x0d between the segments. I would like to use a... (3 Replies)
Discussion started by: gio001
3 Replies

6. UNIX for Dummies Questions & Answers

What is the meaning of this awk expression using sub?

Cannot understand what the "&" in the sub expression is supposed to do. {sub(/^/,"&" s)} (3 Replies)
Discussion started by: kristinu
3 Replies

7. Shell Programming and Scripting

Help in understanding awk expression

Hi, Could somebody help me in understanding the following awk expression: awk -v n="POINT" '/%/{print $0 "\n" n ;next}1' < file name Thanks, Arun (6 Replies)
Discussion started by: arun_maffy
6 Replies

8. Shell Programming and Scripting

awk print expression

Hi All, I have a doubt in awk print exp. Where in some awk commands have seen a digit 1 appended at the end of the awk ,didnt remember the command . like .. cat file |awk '{print }1' Could some one help in understanding these cases where we use them. Regards, Ganesh, (2 Replies)
Discussion started by: rmkganesh
2 Replies

9. Shell Programming and Scripting

Evaluate Expression within awk

I want to create a conditional expression string and pass in an awk script. My script is as below... comm="\$3 == "hello"" awk -F "^T" -v command="${comm}" ' { if ( command ) { print "hye" } }' testBut the statement "if ( command )" always evaluates to true which is not... (5 Replies)
Discussion started by: Saikat123
5 Replies

10. UNIX for Advanced & Expert Users

How to evaluate expression under awk?

I have to display only those subscribers which are in "unconnected state" and the date is 90 days older than today's date. Below command is used for this purpose: cat vfsubscriber_20170817.csv | sed -e 's/^"//' -e '1d' | \ nawk -F '",' '{if ( (substr($11,2,4) == 2017) && ( substr($11,2,8)... (1 Reply)
Discussion started by: dia
1 Replies
GStreamer::Buffer(3pm)					User Contributed Perl Documentation				    GStreamer::Buffer(3pm)

NAME
GStreamer::Buffer - Data-passing buffer type, supporting sub-buffers. METHODS
GstBuffer = GStreamer::Buffer->new caps or undef = $buffer->get_caps $buffer->set_caps ($caps) o $caps (GStreamer::Caps) GstBuffer = $parent->create_sub ($offset, $size) o $offset (integer) o $size (integer) scalar = $buffer->data $buf->set_data ($data) o $data (scalar) unsigned integer = $buffer->duration bufferflag = $buffer->flags boolean = $buf1->is_span_fast ($buf2) o $buf2 (GstBuffer) GstBuffer = $buf1->join ($buf2) o $buf2 (GstBuffer) GstBuffer = $buf1->merge ($buf2) o $buf2 (GstBuffer) 64 bit unsigned = $buffer->offset 64 bit unsigned = $buffer->offset_end integer = $buffer->size GstBuffer = $buf1->span ($offset, $buf2, $len) o $offset (unsigned) o $buf2 (GstBuffer) o $len (unsigned) $dest->stamp ($src) o $src (GstBuffer) unsigned integer = $buffer->timestamp ENUMS AND FLAGS
flags GStreamer::BufferFlag o 'readonly' / 'GST_BUFFER_FLAG_READONLY' o 'media4' / 'GST_BUFFER_FLAG_MEDIA4' o 'preroll' / 'GST_BUFFER_FLAG_PREROLL' o 'discont' / 'GST_BUFFER_FLAG_DISCONT' o 'in-caps' / 'GST_BUFFER_FLAG_IN_CAPS' o 'gap' / 'GST_BUFFER_FLAG_GAP' o 'delta-unit' / 'GST_BUFFER_FLAG_DELTA_UNIT' o 'media1' / 'GST_BUFFER_FLAG_MEDIA1' o 'media2' / 'GST_BUFFER_FLAG_MEDIA2' o 'media3' / 'GST_BUFFER_FLAG_MEDIA3' o 'last' / 'GST_BUFFER_FLAG_LAST' SEE ALSO
GStreamer COPYRIGHT
Copyright (C) 2005-2011 by the gtk2-perl team. This software is licensed under the LGPL. See GStreamer for a full notice. perl v5.14.2 2012-03-01 GStreamer::Buffer(3pm)
All times are GMT -4. The time now is 10:13 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy