Sponsored Content
Top Forums UNIX for Dummies Questions & Answers awk code does not receive input Post 302872781 by Akshay Hegde on Sunday 10th of November 2013 03:13:12 AM
Old 11-10-2013
Quote:
Originally Posted by o2tha1
I'm just starting to understand how awk works and yet this is really driving me crazy. I can't guarantee the rest is correct but I know the input is not being received via the ' $ ' sign. Can anyone tell me what's wrong with my code??
Code:
{
        EAS_ACC=$2;
        NOR_ACC=$3;

        if(((EASTING - 200 <= EAS_ACC) || (EASTING + 200 >=  EAS_ACC)) && ((NORTHING - 200 <= NOR_ACC) || (NORTHING + 200  >= NOR_ACC)))
        {
                print sqrt((EAS_ACC - EASTING) * (EAS_ACC - EASTING) + (NOR_ACC - NORTHING) * (NOR_ACC - NORTHING));
                print " ";
                print ($2 $3 $4 $5);
                print " ";
                print $10;
                print " ";
                print $11;
        }
}

Without knowing $2 and $3 we can't help and where did you define NORTHING and EASTING ?

If you show input and expected output, we can help you.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

awk - input function

hello, im a newbie. how can i input data from keyboard? thanks. (3 Replies)
Discussion started by: Jariya
3 Replies

2. Shell Programming and Scripting

awk/input parameter

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)
Discussion started by: wannalearn
3 Replies

3. Shell Programming and Scripting

2 input files for awk

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)
Discussion started by: koti_rama
6 Replies

4. Shell Programming and Scripting

awk user input

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)
Discussion started by: gefa
17 Replies

5. Shell Programming and Scripting

AWK using two input files

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)
Discussion started by: Ajoy
1 Replies

6. Shell Programming and Scripting

Hard code the input of a script

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)
Discussion started by: mailvkjain
5 Replies

7. Shell Programming and Scripting

Parse input -AWK

Input File Defined configuration: cfg: CLL_DCC_Fabric_A BTS00P21; BAU_AP00P01QC; BAU_LGSCNJP02; BAU_TS00P20; BAU_DSMSM14; BAU_HT00P02; BAU_DSMSM13; BAU_HT00P01; cfg: CX0014_list BAU_TS00P20; BAU_NYP_PRODIAD1_CJ;... (5 Replies)
Discussion started by: greycells
5 Replies

8. Shell Programming and Scripting

User input in perl code

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)
Discussion started by: ajayram_arya
4 Replies

9. Shell Programming and Scripting

User input and run awk using the input

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)
Discussion started by: cmccabe
7 Replies

10. Red Hat

Looking for C code for MQ server to sed/receive messages

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)
Discussion started by: digioleg54
0 Replies
set_color(1)							       fish							      set_color(1)

NAME
set_color - set_color - set the terminal color set_color - set the terminal color Synopsis set_color [-v --version] [-h --help] [-b --background COLOR] [COLOR] Description Change the foreground and/or background color of the terminal. COLOR is one of black, red, green, brown, yellow, blue, magenta, purple, cyan, white and normal. o -b, --background Set the background color o -c, --print-colors Prints a list of all valid color names o -h, --help Display help message and exit o -o, --bold Set bold or extra bright mode o -u, --underline Set underlined mode o -v, --version Display version and exit Calling set_color normal will set the terminal color to whatever is the default color of the terminal. Some terminals use the --bold escape sequence to switch to a brighter color set. On such terminals, set_color white will result in a grey font color, while set_color --bold white will result in a white font color. Not all terminal emulators support all these features. This is not a bug in set_color but a missing feature in the terminal emulator. set_color uses the terminfo database to look up how to change terminal colors on whatever terminal is in use. Some systems have old and incomplete terminfo databases, and may lack color information for terminals that support it. Download and install the latest version of ncurses and recompile fish against it in order to fix this issue. Version 1.23.1 Sun Jan 8 2012 set_color(1)
All times are GMT -4. The time now is 01:23 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy