Sponsored Content
Top Forums UNIX for Advanced & Expert Users can awk built-in "match" be exact?? Post 302276628 by farphe on Wednesday 14th of January 2009 08:50:48 AM
Old 01-14-2009
yes I can use gawk if it makes things easier
 

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

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

3. Shell Programming and Scripting

awk statement to match all lines starting with "#"

Looking for awk statement that will match all lines starting with "# " if ( $1 == \^"#" ) Input file: # of the server. If you would like to set these, please take out the # pound (#) sign in front of one or all severities and set it equal to # severity desired. For example, FATAL=3 #... (2 Replies)
Discussion started by: Arsenalman
2 Replies

4. 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

5. Shell Programming and Scripting

grep regex, match exact string which includes "/" anywhere on line.

I have a file that contains the 2 following lines (from /proc/mounts) /dev/sdc1 /mnt/backup2 xfs rw,relatime,attr2,noquota 0 0 /dev/sdb1 /mnt/backup xfs rw,relatime,attr2,noquota 0 0 I need to match the string in the second column exactly so that only one result is returned, e.g. > grep... (2 Replies)
Discussion started by: jelloir
2 Replies

6. 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

7. Shell Programming and Scripting

"AND" string match using awk

Hiya, Using awk (as I already have an embedded calculation in the command) reading in a file of many thousands of lines I would like to extract only the lines with M values where field one is less than 62: Part example of my input file is: ... 89,63,AAY0772,M 38,66,AAY0772,f... (3 Replies)
Discussion started by: gafoleyo73
3 Replies

8. UNIX for Dummies Questions & Answers

Explanation on problem "match" function awk

Hello Unix experts, If I could get any explanations on why the code below doesn't work it would be great ! My input looks like that ("|" delimited): Saaaaabbbbbccccc|ok Sdddddfffffggggg|ok The goal is, if $2 is "ok", to remove everything before the pattern given in the match function... (5 Replies)
Discussion started by: lucasvs
5 Replies

9. UNIX for Advanced & Expert Users

AIX - io info get from "libperfstat" not match "iostat"

Hi, everyone. I need to write a program to get io info based on libperfstat. But the "write time" of a disk is just half of the value get from iostat. I'm confused and can't explain. Help please. How I calculate "write service time per sec": In iostat: write service... (0 Replies)
Discussion started by: jackliang
0 Replies

10. Shell Programming and Scripting

Search file containing ps results for a match "my.cnf" and then for a second match . "ok:" and

I need to find two matches in the output from ps. I am searching with ps -ef |grep mysql for: my.cnf /bin/sh /usr/bin/mysqld_safe --defaults-file=/data/mysql/master/agis_core/etc/my.cnf after this match I want to search back and match the hostname which is x number of lines back, above the... (2 Replies)
Discussion started by: bash_in_my_head
2 Replies
gt5(1)							      General Commands Manual							    gt5(1)

NAME
gt5 - a diff-capable 'du-browser' SYNOPSIS
gt5 [ dir | file | dir file | file file2 ] [options] DESCRIPTION
gt5 reads the output of du, compares it with a du-log saved by the last run, converts it into HTML and opens the resulting file with a textbrowser. If files are given on the commandline they are expected to be (optionally gzip/bzip2-compressed) logfiles of du -akx /some/dir. It is up to you to take care that the given directories/files represent the same directory. gt5 will show lots of new files if you don't. ;-) OPTIONS
--cut-at float Files and directories that are below float percent of their parents are not shown. Default is 0.1, gt5 will accept values between 0.01 and 30. --debug Turn on debug. Generate HTML files and do not run browser. --diff-dir directory Use directory instead of ~/.gt5-diffs/ to read/store du-logs. This switch is ignored if gt5 is only used with files. --discard Do not save the current state, in other words: be able to diff against the old state again. This feature is disabled if gt5 is only used with files. --help Display brief help. --link-files Also insert links to files to access them from within gt5. This can be very handy if your browser is configured to handle the files MIME-type correctly. This feature is disabled if gt5 is only used with files. --max-depth int Do not show anything below a depth of int directories. Default is 5 (also see BUGS below). --max-lines int Only consider the int biggest files and directories within the output of du. --no-diffs Use this if you are not interested in the history of the directories processed, for example in /tmp. --save-as file DEPRECATED, use du -akx or du -ak (see --with-mounts), save the output to a file and run gt5 against one (ore two) of these files later. --save-state Force saving current state, overwriting a previous --discard. (Some people seem to have gt5 aliased to 'gt5 --discard'.) --verbose Display messages. --with-mounts By default gt5 calls du with -akx to ignore mounted filesystems. Use this to inspect mounted partitions too, i.e. call du with -ak HELPERS
If gawk or a textbrowser are missing and you want to install them into ~/bin (or /usr/local/bin if you have write access there), gt5 comes with the following helpers: --get-gawk Download, compile and install a copy of gawk. --get-links Download, compile and install a copy of links. --get-links2 Download, compile and install a copy of links2. --get-elinks Download, compile and install a copy of elinks. TEXTBROWSERS
It is recommended to use links with gt5. Other textbrowsers are also possible but there are several good reasons why links is given prior- ity over the others: elinks: links is much faster on startup/exit lynx: does not honor a documents coloring netrik: no colors, unfavourable cursor navigation retawq: no colors, can't handle <a name>-tags w3m: Version 0.5.2 and later are known to work. Older versions experienced unfavourable handling of <a name>-tag, unfavourable cursor navigation and no colors Only links/links2, elinks and lynx are now considered usable (and also chosen in that order). See ENVIRONMENT/GT5_BROWSER below. FILES
~/.gt5.html contains a copy of the last run ~/.gt5-diffs/ compressed du-logs are stored here ENVIRONMENT
GT5_BROWSER force using a (specific) textbrowser GT5_CHARSET force using a (specific) charset for HTML header instead of using $LANG GT5_DEBUG_DIR Directory where to write gt5.debug* data if --debug option is set. BUGS
Directories at depth max-depth are not browsable and so look like files. AUTHOR
Thomas Sattler <gt5 at gmx dot net> SEE ALSO
du(1), links(1), elinks(1), lynx(1) gt5 v1.4.0.1 July 2009 gt5(1)
All times are GMT -4. The time now is 04:59 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy