10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
I found this command and would like to know what it means:
gawk 'NR==1{for(i=1;i<=NF;i++)if($i~/FE/)f=i}{for(i=0;i<n;i++)printf"%s%s",i?" ":"",$f;print""}'
It seems to mean if the row =1 assign i to that row, and then if FE is in the top row /column then increment and print the row.
I am... (2 Replies)
Discussion started by: newbie2010
2 Replies
2. Shell Programming and Scripting
Hi,
I have the following input in a file & need output as mentioned below(need counter of every occurance of field which is to be increased by 1).
Input:
919143110065
919143110065
919143110052
918648846132
919143110012
918648873782
919143110152
919143110152
919143110152... (2 Replies)
Discussion started by: siramitsharma
2 Replies
3. Shell Programming and Scripting
Hi,
My input files is like this
axis1 0 1 10
axis2 0 1 5
axis1 1 2 -4
axis2 2 3 -3
axis1 3 4 5
axis2 3 4 -1
axis1 4 5 -6
axis2 4 5 1
Now, these are my following tasks
1. Print a first column for every two rows that has the same value followed by a string.
2. Match on the... (3 Replies)
Discussion started by: jacobs.smith
3 Replies
4. Shell Programming and Scripting
Experts:
LINE1 :This is line one The FIRST line of the file.
LINE2 :This is line two
LINE3 :This is line three with 8 fileds
LINE4 :This is line four
LINE5 :This is line five
LINE6 :This is line six with 8 fileds
I want to delete line 1, and then process the file and want to print lines... (2 Replies)
Discussion started by: rveri
2 Replies
5. Shell Programming and Scripting
Hello, I have an input file like
123,456,789,321,654,987,IN,OUT,2012,000075,CF34EQ
It has 11 fields separated by comma. I am trying to do this
while read string
do
var=$(echo $string | awk -F"," '{print $1,$2,$3,$4,$5,$6,$7,$8,$9,$10,$11}')
set -- $var
echo $1
...
...
echo $10... (3 Replies)
Discussion started by: apenkov
3 Replies
6. Shell Programming and Scripting
while read filer ; do echo $filer $1 $2; ssh $filer vfiler status -r | awk '/running/{host=$1}/Path:/{path=$2;print host,path}'; done < filers.list
this will print
node1
vfiler0 /
vfiler2 /vol/vfiler2_vol0
vfilert /vol/vfiler_vol
vfilert /vol/virt_vol
where node1 = $filer.
however how... (1 Reply)
Discussion started by: riegersteve
1 Replies
7. Shell Programming and Scripting
I am modifying someone else's code. There is a foreach statement printing the contents of a hash.
Can someone give me an example of printing the last element in a hash?
The output currently is
A
B
C
D
E
I want the output to be
E (1 Reply)
Discussion started by: streetfighter2
1 Replies
8. Shell Programming and Scripting
Hello friends, can any one tell what is meaning of this
awk '{print NR ". " $0}' phonebook
i just want to know what is ". " and $0 mean in this.
thanks (2 Replies)
Discussion started by: tarunsavalia
2 Replies
9. Shell Programming and Scripting
Actually I got a list of file end with *.txt
I want to use the same command apply to all the *.txt
Thus I try to find out the fastest way to write those same command in a script and then want to let them run automatics.
For example:
I got the file below:
file1.txt
file2.txt
file3.txt... (4 Replies)
Discussion started by: patrick87
4 Replies
10. Shell Programming and Scripting
The line is simple, use " '{ print $1"]"$2"\"$3THE " NEEDS TO GO HERE$4 }'
I've tried \", "\, ^" and '"" but none of it works. What am I missing? Putting in the [ between $1 and $2 works fine, I just need to do the same with a ".
Thanks. (2 Replies)
Discussion started by: LordJezo
2 Replies
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).
ATTRIBUTES
See attributes(5) for descriptions of the following attributes:
+--------------------+-----------------+
| ATTRIBUTE TYPE | ATTRIBUTE VALUE |
+--------------------+-----------------+
|Availability | SUNWgawk |
+--------------------+-----------------+
|Interface Stability | Volatile |
+--------------------+-----------------+
NOTES
Source for gawk is available on http://opensolaris.org.
Free Software Foundation Nov 3 1999 IGAWK(1)