I'm executing "wc -lc" command in a c shell script to get record count and byte counts and writing them to a file. I get the result with the full pathname of the file. But I do not want the path name to be printed in the output file. I heard that using Awk we can get this but I don't have any... (4 Replies)
Hi,
Im an awk noob and I am having trouble trying to get matches.
Here is my script:
#!/bin/gawk -f
BEGIN {}
$0 ~ /<a href=".*">.*<\/a>/{print}
Ideally I want to be able to get the actual link and print it. In PHP you can do preg_replace and get the match you want by using \\1 where 1... (2 Replies)
HI,
Need awk command to get date and time alone from
Input : "15:29:15 28.08.2010|SCHEDULE: Started program POSG1"
Output expected : "15:29:15 28.08.2010"
Please help. (9 Replies)
Hi,
I have a program written in awk and I want to extend it to do another task.
My program is a list of CVS log reports of a repository. For each file, I have some fields. One of the fields is the comment field. I want to know how I can check if a comment (which is a free text field)... (8 Replies)
I have the following simplified code that I am planning on putting into a larger shell script. I have been butchering it to try and make work amongst google searches and reading awk documentation.
amixer sset Master toggle | awk '{ if ( /^ Front Left/ { print $7 } == // ) print "MUTED" }'I... (2 Replies)
Hello,
I have a bunch of strings of the following format:
11.22.33.44.in-addr.arpa x.y.z.
What I want to do is format each string in this way:
44.33.22.11 x.y.z
i.e. the string conists of two columns, where delimiter is space. I need to output modified first column (delimiter inside... (7 Replies)
Hi all,
I was doing some string manipulation in my script and wanted to try using awk. However, I have been stuck with string compare. A simplified form of my conundrum is given below:
The below prints expected result (prints "Completed because that is the second element"):
$ echo... (5 Replies)
Hi All,
I have a file test.txt.
Content of test.txt :
1 vinay se
2 kumar sse
4 kishore tl
I am extracting the content of file with below command.
awk '$2 ~ "vinay" {print $0}' test.txt
Now instead of hardcoding $2 is there any way pass $2 as variable and compare with a... (7 Replies)