Sponsored Content
Top Forums Shell Programming and Scripting "awk '/[0-9]{4}/' file" not works, why ? Post 302550462 by 915086731 on Thursday 25th of August 2011 11:46:12 PM
Old 08-26-2011
"awk '/[0-9]{4}/' file" not works, why ?

Hello, my question comes with the following code:
Code:
[river@localhost CLI010001]$ cat  fan_get.txt 
Source                                          Speed              Status              Mode
-------------------------------------------------------------------------------------------------------
PS A,Virtual Fan Group #1                       3600 RPM           Normal              Internal
PS A,Virtual Fan Group #1,Fan #1                2700 RPM           Normal
PS A,Virtual Fan Group #1,Fan #2                4300 RPM           Normal
PS A,Virtual Fan Group #1,Fan #3                3000 RPM           Normal
PS A,Virtual Fan Group #1,Fan #4                4300 RPM           Normal
PS A,Virtual Fan Group #1,Fan #5                3000 RPM           Normal
PS A,Virtual Fan Group #1,Fan #6                4700 RPM           Normal
PS A,Virtual Fan Group #1,Fan #7                2800 RPM           Normal
PS A,Virtual Fan Group #1,Fan #8                4400 RPM           Normal
PS B,Virtual Fan Group #2                       3500 RPM           Normal              Internal
PS B,Virtual Fan Group #2,Fan #1                2500 RPM           Normal
PS B,Virtual Fan Group #2,Fan #2                4000 RPM           Normal
PS B,Virtual Fan Group #2,Fan #3                2500 RPM           Normal
PS B,Virtual Fan Group #2,Fan #4                4300 RPM           Normal
PS B,Virtual Fan Group #2,Fan #5                2800 RPM           Normal
PS B,Virtual Fan Group #2,Fan #6                4500 RPM           Normal
PS B,Virtual Fan Group #2,Fan #7                3100 RPM           Normal
PS B,Virtual Fan Group #2,Fan #8                4400 RPM           Normal
-------------------------------------------------------------------------------------------------------

[river@localhost CLI010001]$ awk '/[0-9]{4}/' fan_get.txt 
[river@localhost CLI010001]$

Why I get no output after execute "awk '/[0-9]{4}/' fan_get.txt " ? I think many lines match it, e.g. 4400, 3100 ... ,
Thanks!
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Explain the line "mn_code=`env|grep "..mn"|awk -F"=" '{print $2}'`"

Hi Friends, Can any of you explain me about the below line of code? mn_code=`env|grep "..mn"|awk -F"=" '{print $2}'` Im not able to understand, what exactly it is doing :confused: Any help would be useful for me. Lokesha (4 Replies)
Discussion started by: Lokesha
4 Replies

2. Shell Programming and Scripting

help for saving vertical datas to horizontal with "awk" or "cut"

hi, i have a file having datas like that ./a.txt 12344 12345 12346 12347 ..... ..... ... i want to save this datas to another file like that ./b.txt 12344 12345 12346 12347 ... ... ... i think awk can make this but how? :) waiting for ur help. (3 Replies)
Discussion started by: mercury
3 Replies

3. Shell Programming and Scripting

cat $como_file | awk /^~/'{print $1","$2","$3","$4}' | sed -e 's/~//g'

hi All, cat file_name | awk /^~/'{print $1","$2","$3","$4}' | sed -e 's/~//g' Can this be done by using sed or awk alone (4 Replies)
Discussion started by: harshakusam
4 Replies

4. Shell Programming and Scripting

Help to change the file with "sed" and "awk"

Hi experts I want your help to change the file format to my wanted version, please give me a hand thanks $cat file install pass make os pass make build kernel failed usb storage pass chane to | *install* | *make os* | *make build kernel* | *usb storage* | | pass | pass... (7 Replies)
Discussion started by: yanglei_fage
7 Replies

5. Shell Programming and Scripting

awk command to replace ";" with "|" and ""|" at diferent places in line of file

Hi, I have line in input file as below: 3G_CENTRAL;INDONESIA_(M)_TELKOMSEL;SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL My expected output for line in the file must be : "1-Radon1-cMOC_deg"|"LDIndex"|"3G_CENTRAL|INDONESIA_(M)_TELKOMSEL"|LAST|"SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL" Can someone... (7 Replies)
Discussion started by: shis100
7 Replies

6. UNIX for Dummies Questions & Answers

script works well but displays " line 6: =: No such file or directory"

strange :) can you tell why?:cool: #!/bin/bash echo " enter your age " read age if ; then echo " you do not have to pay tax " elif ]; then echo " you are eligible for income tax " else echo " you dont have to pay tax " fi (3 Replies)
Discussion started by: me.
3 Replies

7. Red Hat

files having Script which works behind "who" & "w" commands

Dear All, plz print the path of files which have the script of "who" & "w" commands. thnx in advance. (6 Replies)
Discussion started by: saqlain.bashir
6 Replies

8. Shell Programming and Scripting

how to use "cut" or "awk" or "sed" to remove a string

logs: "/home/abc/public_html/index.php" "/home/abc/public_html/index.php" "/home/xyz/public_html/index.php" "/home/xyz/public_html/index.php" "/home/xyz/public_html/index.php" how to use "cut" or "awk" or "sed" to get the following result: abc abc xyz xyz xyz (8 Replies)
Discussion started by: timmywong
8 Replies

9. UNIX for Dummies Questions & Answers

Using "mailx" command to read "to" and "cc" email addreses from input file

How to use "mailx" command to do e-mail reading the input file containing email address, where column 1 has name and column 2 containing “To” e-mail address and column 3 contains “cc” e-mail address to include with same email. Sample input file, email.txt Below is an sample code where... (2 Replies)
Discussion started by: asjaiswal
2 Replies

10. Shell Programming and Scripting

Bash script - Print an ascii file using specific font "Latin Modern Mono 12" "regular" "9"

Hello. System : opensuse leap 42.3 I have a bash script that build a text file. I would like the last command doing : print_cmd -o page-left=43 -o page-right=22 -o page-top=28 -o page-bottom=43 -o font=LatinModernMono12:regular:9 some_file.txt where : print_cmd ::= some printing... (1 Reply)
Discussion started by: jcdole
1 Replies
DateTime::Locale::kfo(3)				User Contributed Perl Documentation				  DateTime::Locale::kfo(3)

NAME
DateTime::Locale::kfo SYNOPSIS
use DateTime; my $dt = DateTime->now( locale => 'kfo' ); print $dt->month_name(); DESCRIPTION
This is the DateTime locale package for Koro. DATA
This locale inherits from the DateTime::Locale::root locale. It contains the following data. Days Wide (format) Je-Kubacha Je-Gbai Tansati Je-Yei Je-Koye Sati Lahadi Abbreviated (format) Kub Gba Tan Yei Koy Sat Lah Narrow (format) 2 3 4 5 6 7 1 Wide (stand-alone) Je-Kubacha Je-Gbai Tansati Je-Yei Je-Koye Sati Lahadi Abbreviated (stand-alone) Kub Gba Tan Yei Koy Sat Lah Narrow (stand-alone) 2 3 4 5 6 7 1 Months Wide (format) Fai Weyene Fai Fani Fai Tataka Fai Nangra Fai Tuyo Fai Tsoyi Fai Tafaka Fai Warachi Fai Kunobok Fai Bansok Fai Kom Fai Sauk Abbreviated (format) Wey Fan Tat Nan Tuy Tso Taf War Kun Ban Kom Sau Narrow (format) 1 2 3 4 5 6 7 8 9 10 11 12 Wide (stand-alone) Fai Weyene Fai Fani Fai Tataka Fai Nangra Fai Tuyo Fai Tsoyi Fai Tafaka Fai Warachi Fai Kunobok Fai Bansok Fai Kom Fai Sauk Abbreviated (stand-alone) Wey Fan Tat Nan Tuy Tso Taf War Kun Ban Kom Sau Narrow (stand-alone) 1 2 3 4 5 6 7 8 9 10 11 12 Quarters Wide (format) Q1 Q2 Q3 Q4 Abbreviated (format) Q1 Q2 Q3 Q4 Narrow (format) 1 2 3 4 Wide (stand-alone) Q1 Q2 Q3 Q4 Abbreviated (stand-alone) Q1 Q2 Q3 Q4 Narrow (stand-alone) 1 2 3 4 Eras Wide Kafi Mar Wenom Bayan Chi Wenom Abbreviated KMW BCW Narrow KMW BCW Date Formats Full 2008-02-05T18:30:30 = Je-Gbai, 2008 Fai Fani 05 1995-12-22T09:05:02 = Je-Koye, 1995 Fai Sauk 22 -0010-09-15T04:44:23 = Sati, -10 Fai Kunobok 15 Long 2008-02-05T18:30:30 = 2008 Fai Fani 5 1995-12-22T09:05:02 = 1995 Fai Sauk 22 -0010-09-15T04:44:23 = -10 Fai Kunobok 15 Medium 2008-02-05T18:30:30 = 2008 Fan 5 1995-12-22T09:05:02 = 1995 Sau 22 -0010-09-15T04:44:23 = -10 Kun 15 Short 2008-02-05T18:30:30 = 08/02/05 1995-12-22T09:05:02 = 95/12/22 -0010-09-15T04:44:23 = -10/09/15 Default 2008-02-05T18:30:30 = 2008 Fan 5 1995-12-22T09:05:02 = 1995 Sau 22 -0010-09-15T04:44:23 = -10 Kun 15 Time Formats Full 2008-02-05T18:30:30 = 18:30:30 UTC 1995-12-22T09:05:02 = 09:05:02 UTC -0010-09-15T04:44:23 = 04:44:23 UTC Long 2008-02-05T18:30:30 = 18:30:30 UTC 1995-12-22T09:05:02 = 09:05:02 UTC -0010-09-15T04:44:23 = 04:44:23 UTC Medium 2008-02-05T18:30:30 = 18:30:30 1995-12-22T09:05:02 = 09:05:02 -0010-09-15T04:44:23 = 04:44:23 Short 2008-02-05T18:30:30 = 18:30 1995-12-22T09:05:02 = 09:05 -0010-09-15T04:44:23 = 04:44 Default 2008-02-05T18:30:30 = 18:30:30 1995-12-22T09:05:02 = 09:05:02 -0010-09-15T04:44:23 = 04:44:23 Datetime Formats Full 2008-02-05T18:30:30 = Je-Gbai, 2008 Fai Fani 05 18:30:30 UTC 1995-12-22T09:05:02 = Je-Koye, 1995 Fai Sauk 22 09:05:02 UTC -0010-09-15T04:44:23 = Sati, -10 Fai Kunobok 15 04:44:23 UTC Long 2008-02-05T18:30:30 = 2008 Fai Fani 5 18:30:30 UTC 1995-12-22T09:05:02 = 1995 Fai Sauk 22 09:05:02 UTC -0010-09-15T04:44:23 = -10 Fai Kunobok 15 04:44:23 UTC Medium 2008-02-05T18:30:30 = 2008 Fan 5 18:30:30 1995-12-22T09:05:02 = 1995 Sau 22 09:05:02 -0010-09-15T04:44:23 = -10 Kun 15 04:44:23 Short 2008-02-05T18:30:30 = 08/02/05 18:30 1995-12-22T09:05:02 = 95/12/22 09:05 -0010-09-15T04:44:23 = -10/09/15 04:44 Default 2008-02-05T18:30:30 = 2008 Fan 5 18:30:30 1995-12-22T09:05:02 = 1995 Sau 22 09:05:02 -0010-09-15T04:44:23 = -10 Kun 15 04:44:23 Available Formats d (d) 2008-02-05T18:30:30 = 5 1995-12-22T09:05:02 = 22 -0010-09-15T04:44:23 = 15 EEEd (d EEE) 2008-02-05T18:30:30 = 5 Gba 1995-12-22T09:05:02 = 22 Koy -0010-09-15T04:44:23 = 15 Sat Hm (H:mm) 2008-02-05T18:30:30 = 18:30 1995-12-22T09:05:02 = 9:05 -0010-09-15T04:44:23 = 4:44 hm (h:mm a) 2008-02-05T18:30:30 = 6:30 PM 1995-12-22T09:05:02 = 9:05 AM -0010-09-15T04:44:23 = 4:44 AM Hms (H:mm:ss) 2008-02-05T18:30:30 = 18:30:30 1995-12-22T09:05:02 = 9:05:02 -0010-09-15T04:44:23 = 4:44:23 hms (h:mm:ss a) 2008-02-05T18:30:30 = 6:30:30 PM 1995-12-22T09:05:02 = 9:05:02 AM -0010-09-15T04:44:23 = 4:44:23 AM M (L) 2008-02-05T18:30:30 = 2 1995-12-22T09:05:02 = 12 -0010-09-15T04:44:23 = 9 Md (M-d) 2008-02-05T18:30:30 = 2-5 1995-12-22T09:05:02 = 12-22 -0010-09-15T04:44:23 = 9-15 MEd (E, M-d) 2008-02-05T18:30:30 = Gba, 2-5 1995-12-22T09:05:02 = Koy, 12-22 -0010-09-15T04:44:23 = Sat, 9-15 MMM (LLL) 2008-02-05T18:30:30 = Fan 1995-12-22T09:05:02 = Sau -0010-09-15T04:44:23 = Kun MMMd (MMM d) 2008-02-05T18:30:30 = Fan 5 1995-12-22T09:05:02 = Sau 22 -0010-09-15T04:44:23 = Kun 15 MMMEd (E MMM d) 2008-02-05T18:30:30 = Gba Fan 5 1995-12-22T09:05:02 = Koy Sau 22 -0010-09-15T04:44:23 = Sat Kun 15 MMMMd (MMMM d) 2008-02-05T18:30:30 = Fai Fani 5 1995-12-22T09:05:02 = Fai Sauk 22 -0010-09-15T04:44:23 = Fai Kunobok 15 MMMMEd (E MMMM d) 2008-02-05T18:30:30 = Gba Fai Fani 5 1995-12-22T09:05:02 = Koy Fai Sauk 22 -0010-09-15T04:44:23 = Sat Fai Kunobok 15 ms (mm:ss) 2008-02-05T18:30:30 = 30:30 1995-12-22T09:05:02 = 05:02 -0010-09-15T04:44:23 = 44:23 y (y) 2008-02-05T18:30:30 = 2008 1995-12-22T09:05:02 = 1995 -0010-09-15T04:44:23 = -10 yM (y-M) 2008-02-05T18:30:30 = 2008-2 1995-12-22T09:05:02 = 1995-12 -0010-09-15T04:44:23 = -10-9 yMEd (EEE, y-M-d) 2008-02-05T18:30:30 = Gba, 2008-2-5 1995-12-22T09:05:02 = Koy, 1995-12-22 -0010-09-15T04:44:23 = Sat, -10-9-15 yMMM (y MMM) 2008-02-05T18:30:30 = 2008 Fan 1995-12-22T09:05:02 = 1995 Sau -0010-09-15T04:44:23 = -10 Kun yMMMEd (EEE, y MMM d) 2008-02-05T18:30:30 = Gba, 2008 Fan 5 1995-12-22T09:05:02 = Koy, 1995 Sau 22 -0010-09-15T04:44:23 = Sat, -10 Kun 15 yMMMM (y MMMM) 2008-02-05T18:30:30 = 2008 Fai Fani 1995-12-22T09:05:02 = 1995 Fai Sauk -0010-09-15T04:44:23 = -10 Fai Kunobok yQ (y Q) 2008-02-05T18:30:30 = 2008 1 1995-12-22T09:05:02 = 1995 4 -0010-09-15T04:44:23 = -10 3 yQQQ (y QQQ) 2008-02-05T18:30:30 = 2008 Q1 1995-12-22T09:05:02 = 1995 Q4 -0010-09-15T04:44:23 = -10 Q3 yyQ (Q yy) 2008-02-05T18:30:30 = 1 08 1995-12-22T09:05:02 = 4 95 -0010-09-15T04:44:23 = 3 -10 Miscellaneous Prefers 24 hour time? Yes Local first day of the week Je-Kubacha SUPPORT
See DateTime::Locale. AUTHOR
Dave Rolsky <autarch@urth.org> COPYRIGHT
Copyright (c) 2008 David Rolsky. All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. This module was generated from data provided by the CLDR project, see the LICENSE.cldr in this distribution for details on the CLDR data's license. perl v5.18.2 2017-10-06 DateTime::Locale::kfo(3)
All times are GMT -4. The time now is 07:09 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy