I have a file that contains the following lines
the brown quick fox
jumped over
the white laze dog
0123456789
I wanted to put the contents of this file into a variable so I used this code:
VAR_LIST=`cat $2`
where $2 is the file name passed as an argument to the script
If I... (3 Replies)
Hello, I have a script that generates the following file named /tmp/rfkill:
rf55 pts/13 Jul 10 06:38 (10.72.11.44)
15782 pts/13 5:07 b
rf56 pts/15 Jul 10 06:53 (10.72.11.9)
18552 pts/15 0:28 b
rf55 pts/39 Jul 10 09:12 (10.72.11.44)
19354 pts/39... (4 Replies)
Hi all,
I have a file which contains comments,dotted lines(-------),actual records etc.I need to fetch only the actual records and put into a new file neglecting/deleting other rows.I have a header record too which contains the column names for the actual records.i need to discard this too.how... (5 Replies)
Hi,
using awk /sed, I need to sort out the input file.
here is the example
input file===
Name= shashi | country= india | region = asia | dept= ww
Name= jon | region = asia | dept= xx
Name=sam | dept= ww
Name= anthony | country=england | dept= xx
Name= sumo | country= china
output... (3 Replies)
I have files that store multiple data points for the same device "vertically" and include multiple devices. It repeats a consistant pattern of lines where for each line:
Column 1 is a common number for the entire file and all devices in that file
Column 2 is a unique device number
Column 3 is... (7 Replies)
Hi Everyone,
#!/usr/bin/perl
use strict;
use warnings;
my @test=("a;b;qqq;c;d","a;b;ggg;c;d","a;b;qqq;c;d");
would like to split the @test array into two array:
@test1=(("a;b;qqq;c;d","a;b;qqq;c;d"); and @test2=("a;b;ggg;c;d");
means search for 3rd filed.
Thanks
find the... (0 Replies)
Hi everyone,
Please some help over here.
I've written the below script using ranges (/Initial_pattern/,/Final_Pattern/)to extract only those lines of interest for me:
awk '
/^Category/,/^$/{print $1};
/Titles/,/^$/{print $1};
/Authors/,/^$/{print $1}' inputfile
To process this input:... (8 Replies)
Hi,
I have a file called "readfile" it contains below parameters
#cat readfile
word=/abc=225,/abc/cba=150 three=12 four=45 five=/xyz/yza
likewise multiple line.
From the above file, I have to read "word"
output should be like,
/abc
/abc/cba
these values need to be put in... (3 Replies)
I really can't figure this one out.
I have 2 files, one file is a list of hostnames and the other is a list of their corresponding IPs:
fileA:
example.com
another.org
thirdie.net
fileB:
1.1.1.1
2.2.2.2
3.3.3.3
I want to create a fileC that looks like:
example.com 1.1.1.1... (2 Replies)
I create a CGI in bash/html.
My awk script looks like :
echo "<table>"
for fn in /var/www/cgi-bin/LPAR_MAP/*;
do
echo "<td>"
echo "<PRE>"
awk -F',|;' -v test="$test" '
NR==1 {
split(FILENAME ,a,"");
}
$0 ~ test {
if(!header++){
... (12 Replies)
Discussion started by: Tim2424
12 Replies
LEARN ABOUT DEBIAN
igawk
IGAWK(1) Utility Commands IGAWK(1)NAME
igawk - gawk with include files
SYNOPSIS
igawk [ all gawk options ] -f program-file [ -- ] file ...
igawk [ all gawk options ] [ -- ] program-text file ...
DESCRIPTION
Igawk is a simple shell script that adds the ability to have ``include files'' to gawk(1).
AWK programs for igawk are the same as for gawk, except that, in addition, you may have lines like
@include getopt.awk
in your program to include the file getopt.awk from either the current directory or one of the other directories in the search path.
OPTIONS
See gawk(1) for a full description of the AWK language and the options that gawk supports.
EXAMPLES
cat << EOF > test.awk
@include getopt.awk
BEGIN {
while (getopt(ARGC, ARGV, "am:q") != -1)
...
}
EOF
igawk -f test.awk
SEE ALSO gawk(1)
Effective AWK Programming, Edition 1.0, published by the Free Software Foundation, 1995.
AUTHOR
Arnold Robbins (arnold@skeeve.com).
Free Software Foundation Nov 3 1999 IGAWK(1)