awk takes a file as input.
The $1 $2 are set from its fields.
Give the file name as parameter.
Addional parameters can set awk variables.
For example, assuming your awk code is saved in the file awkscript
Last edited by MadeInGermany; 11-11-2013 at 05:40 AM..
Reason: -f not -F
Hi,
My script takes in one input parameter($1-email id) on the command line...
The script contains something like this...
awk '$1 == 400' abc.log >def.log
mail -s subject $1 <def.log
abc.log looks something like this...
300 222 330 123 445
400 098 890 727 663
How do i make the... (3 Replies)
Hi,
i have 2 files like f1 and f2
f1:
1
Note: some times it will be cahnged to 2 and 3.
f2:
1:20
2:30
4:50
6:70
8:90
3:20
1:30
1:40
output:
1:80
(sum of 1) (6 Replies)
Using the following I'm trying to print the user's response to the prompt Y / N but I get nothing other than the contents of $1?
awk '{
printf($1 " ? (Y/N)")
getline myresponse < "-"
system("read myresponse")
if (myresponse == "Y")
{ print $1... (17 Replies)
Hi ,
i have two input files one is input.gz and another is ( input.txt) text file.in gz format input file each record contains 10 fields and corresponding header value is present in the text file as a single record i.e text file contains only 10 records which is header value,so output of the awk... (1 Reply)
Hi All,
I have a script Abc . This is has only the privilege of execution. I cannot see the code. When I run the script "Abc" , It display set of name in an random order with a number 1.e
1 James
2 john
3 jack
4 neil
5 bob
If my name is neil , I am expected to type 4 and press enter
Now... (5 Replies)
Hello friends . I am newbie to perl scripting but still managed to write a code but i am stuck at a place where i need help . Below is the code and can someone help me in taking user input for changing the font size for a html table .Thank you in advance
#!/bin/ksh
echo " Enter the Directory... (4 Replies)
I am trying to allow a user to enter in text and then store that text in a variable $gene to run in an awk command in which those values are used to run some calculations. I am getting syntax errors however, when I try. Thank you :).
The awk runs great if it is a pre-defined file that is used,... (7 Replies)
I am working on C program to connect to MQ websphere server send/receive messages. Can somebody give me examples of such program?
Thanks for contribution (0 Replies)