Sponsored Content
Top Forums Shell Programming and Scripting finding line number if the line contains Post 302250252 by Franklin52 on Thursday 23rd of October 2008 03:08:34 AM
Old 10-23-2008
Use the octal or hex value of the single quotes instead of single quotes in your pattern (\047 or \x027):

Code:
lineno1=$(awk '/473/ && /a GFT \047CTL\047 message extracted from message buffer./{print NR}' $FILE)

Regards
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Finding the line number of matching braces

Hi,I am new to shell scripting and i want to find the line numbers of matching braces. The file contents are as follows File XXX.dat 1 ( CLASS "FRUIT" 2 (TYPE "PERSISTENT") 3 (MESSAGE_TYPE "M") 4 (GET_REQRD "Y") 5 (SET_REQRD "Y") 6 ) 7 ( CLASS... (3 Replies)
Discussion started by: Rajendra_1510
3 Replies

2. Shell Programming and Scripting

awk or sed for finding closest pattern to a line number

hi guys, I want to do pattern matching with awk or sed but I don't know how. here's what I want: I have a line number for a pattern that I have already found using grep, and I know a pattern like "---" that happens a few lines above that certain line number. I want to print out the chunk... (1 Reply)
Discussion started by: alirezan
1 Replies

3. Shell Programming and Scripting

finding the line number from a grep ?

Hi there does anybody know how i can get the line number from an entry or entries in a file ?? for example if i had a file test1 test2 test3 test1 and i needed to get the line numbers for all instances of test1 in that file with the answer being (1,4) Would anybody be able... (7 Replies)
Discussion started by: hcclnoodles
7 Replies

4. Shell Programming and Scripting

finding the number of occurence of a word in a line

suppose i have this line abs|der|gt|dftnrk|dtre i want to count the number of "|" in this line.. how can i do that. plz help:confused: (9 Replies)
Discussion started by: priyanka3006
9 Replies

5. Shell Programming and Scripting

Finding line with highest number in a file

Hi All, My file looks some thing like this, File 1: - A 10 B 30 C 5 D 25 E 72 F 23 now my requirement is to find the line with highest number in it, i;e the result should be E 72 Thanks in Advance (1 Reply)
Discussion started by: balu_puttaganti
1 Replies

6. UNIX for Dummies Questions & Answers

How to read contents of a file from a given line number upto line number again specified by user

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

7. Shell Programming and Scripting

Finding the line with the exact same number

Hello All, What i am doing is , i tail a file from certain chatacter and then cat -n to get the line numbers.I search for a particular string and gets it line number. What i am interested in is the next line immediately after the pattern i search. But grep gives me result for all line... (5 Replies)
Discussion started by: kailash19
5 Replies

8. Shell Programming and Scripting

finding the line number of a particular line in a file

Hi Frnds, I need to find the line number of a particular line in a file and store that line number to a variable. if a file named myfile contains following look at the sun look at the moon look at the star look at the ocean i need to get the line number of the line 'look at the... (3 Replies)
Discussion started by: mvignesh
3 Replies

9. Shell Programming and Scripting

help for fast way of finding line number for a regex

Hello, I am trying to find out the line numbers where regex match and put them into a file with below command: awk '/'$pat'/ {print NR}' $fileName >> temp.txt where $pat is the regex but this command is taking a lot of time to execute with bigger files for size more than 5000000... (8 Replies)
Discussion started by: JoeColeEPL9
8 Replies

10. Shell Programming and Scripting

sed command to replace a line at a specific line number with some other line

my requirement is, consider a file output cat output blah sdjfhjkd jsdfhjksdh sdfs 23423 sdfsdf sdf"sdfsdf"sdfsdf"""""dsf hellow there this doesnt look good et cetc etc etcetera i want to replace a line of line number 4 ("this doesnt look good") with some other line ... (3 Replies)
Discussion started by: vivek d r
3 Replies
Locale::RecodeData::US_ASCII(3) 			User Contributed Perl Documentation			   Locale::RecodeData::US_ASCII(3)

NAME
Locale::RecodeData::US_ASCII - Conversion routines for US-ASCII SYNOPSIS
This module is internal to libintl. Do not use directly! DESCRIPTION
This module contains the conversion tables and routines for US-ASCII. CHARACTER TABLE
The following table is sorted in the same order as the original charmap. All character codes are in hexadecimal. Please read 'ISO-10646' as 'ISO-10646-UCS4'. Local | ISO-10646 | Description -------+-----------+------------------------------------------------- 00 | 00000000 | NULL (NUL) 01 | 00000001 | START OF HEADING (SOH) 02 | 00000002 | START OF TEXT (STX) 03 | 00000003 | END OF TEXT (ETX) 04 | 00000004 | END OF TRANSMISSION (EOT) 05 | 00000005 | ENQUIRY (ENQ) 06 | 00000006 | ACKNOWLEDGE (ACK) 07 | 00000007 | BELL (BEL) 08 | 00000008 | BACKSPACE (BS) 09 | 00000009 | CHARACTER TABULATION (HT) 0A | 0000000A | LINE FEED (LF) 0B | 0000000B | LINE TABULATION (VT) 0C | 0000000C | FORM FEED (FF) 0D | 0000000D | CARRIAGE RETURN (CR) 0E | 0000000E | SHIFT OUT (SO) 0F | 0000000F | SHIFT IN (SI) 10 | 00000010 | DATALINK ESCAPE (DLE) 11 | 00000011 | DEVICE CONTROL ONE (DC1) 12 | 00000012 | DEVICE CONTROL TWO (DC2) 13 | 00000013 | DEVICE CONTROL THREE (DC3) 14 | 00000014 | DEVICE CONTROL FOUR (DC4) 15 | 00000015 | NEGATIVE ACKNOWLEDGE (NAK) 16 | 00000016 | SYNCHRONOUS IDLE (SYN) 17 | 00000017 | END OF TRANSMISSION BLOCK (ETB) 18 | 00000018 | CANCEL (CAN) 19 | 00000019 | END OF MEDIUM (EM) 1A | 0000001A | SUBSTITUTE (SUB) 1B | 0000001B | ESCAPE (ESC) 1C | 0000001C | FILE SEPARATOR (IS4) 1D | 0000001D | GROUP SEPARATOR (IS3) 1E | 0000001E | RECORD SEPARATOR (IS2) 1F | 0000001F | UNIT SEPARATOR (IS1) 20 | 00000020 | SPACE 21 | 00000021 | EXCLAMATION MARK 22 | 00000022 | QUOTATION MARK 23 | 00000023 | NUMBER SIGN 24 | 00000024 | DOLLAR SIGN 25 | 00000025 | PERCENT SIGN 26 | 00000026 | AMPERSAND 27 | 00000027 | APOSTROPHE 28 | 00000028 | LEFT PARENTHESIS 29 | 00000029 | RIGHT PARENTHESIS 2A | 0000002A | ASTERISK 2B | 0000002B | PLUS SIGN 2C | 0000002C | COMMA 2D | 0000002D | HYPHEN-MINUS 2E | 0000002E | FULL STOP 2F | 0000002F | SOLIDUS 30 | 00000030 | DIGIT ZERO 31 | 00000031 | DIGIT ONE 32 | 00000032 | DIGIT TWO 33 | 00000033 | DIGIT THREE 34 | 00000034 | DIGIT FOUR 35 | 00000035 | DIGIT FIVE 36 | 00000036 | DIGIT SIX 37 | 00000037 | DIGIT SEVEN 38 | 00000038 | DIGIT EIGHT 39 | 00000039 | DIGIT NINE 3A | 0000003A | COLON 3B | 0000003B | SEMICOLON 3C | 0000003C | LESS-THAN SIGN 3D | 0000003D | EQUALS SIGN 3E | 0000003E | GREATER-THAN SIGN 3F | 0000003F | QUESTION MARK 40 | 00000040 | COMMERCIAL AT 41 | 00000041 | LATIN CAPITAL LETTER A 42 | 00000042 | LATIN CAPITAL LETTER B 43 | 00000043 | LATIN CAPITAL LETTER C 44 | 00000044 | LATIN CAPITAL LETTER D 45 | 00000045 | LATIN CAPITAL LETTER E 46 | 00000046 | LATIN CAPITAL LETTER F 47 | 00000047 | LATIN CAPITAL LETTER G 48 | 00000048 | LATIN CAPITAL LETTER H 49 | 00000049 | LATIN CAPITAL LETTER I 4A | 0000004A | LATIN CAPITAL LETTER J 4B | 0000004B | LATIN CAPITAL LETTER K 4C | 0000004C | LATIN CAPITAL LETTER L 4D | 0000004D | LATIN CAPITAL LETTER M 4E | 0000004E | LATIN CAPITAL LETTER N 4F | 0000004F | LATIN CAPITAL LETTER O 50 | 00000050 | LATIN CAPITAL LETTER P 51 | 00000051 | LATIN CAPITAL LETTER Q 52 | 00000052 | LATIN CAPITAL LETTER R 53 | 00000053 | LATIN CAPITAL LETTER S 54 | 00000054 | LATIN CAPITAL LETTER T 55 | 00000055 | LATIN CAPITAL LETTER U 56 | 00000056 | LATIN CAPITAL LETTER V 57 | 00000057 | LATIN CAPITAL LETTER W 58 | 00000058 | LATIN CAPITAL LETTER X 59 | 00000059 | LATIN CAPITAL LETTER Y 5A | 0000005A | LATIN CAPITAL LETTER Z 5B | 0000005B | LEFT SQUARE BRACKET 5C | 0000005C | REVERSE SOLIDUS 5D | 0000005D | RIGHT SQUARE BRACKET 5E | 0000005E | CIRCUMFLEX ACCENT 5F | 0000005F | LOW LINE 60 | 00000060 | GRAVE ACCENT 61 | 00000061 | LATIN SMALL LETTER A 62 | 00000062 | LATIN SMALL LETTER B 63 | 00000063 | LATIN SMALL LETTER C 64 | 00000064 | LATIN SMALL LETTER D 65 | 00000065 | LATIN SMALL LETTER E 66 | 00000066 | LATIN SMALL LETTER F 67 | 00000067 | LATIN SMALL LETTER G 68 | 00000068 | LATIN SMALL LETTER H 69 | 00000069 | LATIN SMALL LETTER I 6A | 0000006A | LATIN SMALL LETTER J 6B | 0000006B | LATIN SMALL LETTER K 6C | 0000006C | LATIN SMALL LETTER L 6D | 0000006D | LATIN SMALL LETTER M 6E | 0000006E | LATIN SMALL LETTER N 6F | 0000006F | LATIN SMALL LETTER O 70 | 00000070 | LATIN SMALL LETTER P 71 | 00000071 | LATIN SMALL LETTER Q 72 | 00000072 | LATIN SMALL LETTER R 73 | 00000073 | LATIN SMALL LETTER S 74 | 00000074 | LATIN SMALL LETTER T 75 | 00000075 | LATIN SMALL LETTER U 76 | 00000076 | LATIN SMALL LETTER V 77 | 00000077 | LATIN SMALL LETTER W 78 | 00000078 | LATIN SMALL LETTER X 79 | 00000079 | LATIN SMALL LETTER Y 7A | 0000007A | LATIN SMALL LETTER Z 7B | 0000007B | LEFT CURLY BRACKET 7C | 0000007C | VERTICAL LINE 7D | 0000007D | RIGHT CURLY BRACKET 7E | 0000007E | TILDE 7F | 0000007F | DELETE (DEL) AUTHOR
Copyright (C) 2002-2009, Guido Flohr <guido@imperia.net>, all rights reserved. See the source code for details. This software is contributed to the Perl community by Imperia (<http://www.imperia.net/>). SEE ALSO
Locale::RecodeData(3), Locale::Recode(3), perl(1) POD ERRORS
Hey! The above document had some coding errors, which are explained below: Around line 226: =cut found outside a pod block. Skipping to next block. perl v5.16.3 2014-06-10 Locale::RecodeData::US_ASCII(3)
All times are GMT -4. The time now is 09:50 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy