Sponsored Content
Top Forums Shell Programming and Scripting Listing strings from file using awr Linux Red Hat Post 303000048 by RavinderSingh13 on Monday 3rd of July 2017 11:45:18 AM
Old 07-03-2017
Quote:
Originally Posted by carlino70
R. Singh, the test doesn´t shows any result:
Code:
awk '/Point ID/{sub(/.*\./,"",$3);VAL=$3;next} /^value/{print VAL,$2}'  salida_test

Thanks for your help
Hello carlino70,

I have the same Input_file as you posted and after running my code I am getting expected results successfully too as follows.
Code:
awk '/Point ID/{sub(/.*\./,"",$3);VAL=$3;next} /^value/{print VAL,$2}'   Input_file
750251 2
140147 2

Make sure you are NOT having control M characters in your Input_file, you could check that by cat -v Input_file, let me know how it goes then.

Thanks,
R. Singh
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Red Hat Linux 6.0

Ok here is my problem i do not know the command to load a driver for my network card in Ted hat linux 6.0 could sombody give me a hand. and if there is anyone that has a list of commands for red hat that would be great also (2 Replies)
Discussion started by: bbutler3295
2 Replies

2. UNIX for Dummies Questions & Answers

Slackware's Linux 3.0 VS Red Hat Linux 7.x

Hello guys, I got overzealous (I Think). I got the book Linux Unleashed that comes with the Slackware 3.0 Version of Linux for $2.00.I also have Red Hat Linux 7.2 (No book, just the OS).What I wanted to know was,other than the bells and whistles of Red Hat is there any significant difference... (2 Replies)
Discussion started by: perrylx
2 Replies

3. UNIX for Dummies Questions & Answers

XP to Linux (Red Hat)

I have a PC running XP, and I have a PC that dual boots W2K and Red Hat Linux 7.3. I have the two connected via crossover cable, and the two can access each other when both are running windows. If I were to boot up Linux, can my XP PC telnet to the Linux PC? Any pointers or websites to... (3 Replies)
Discussion started by: lawadm1
3 Replies

4. Linux

Red Hat Linux 9

Hello there! Will anybody please tell me some good links to online eBooks on Red Hat Linux 9 user experiences and the like. If the books are in PDF Format, it will be nice to read. Thanks for cooperation in advance. Enjoy using open source and breathe freely! JAM (5 Replies)
Discussion started by: Jawwad
5 Replies

5. Red Hat

Red Hat Linux document

Hi Friends, I am working in new platform I need the document for Red hat Linux. Anybody have pls share with me. Regards, Thangadurai M (2 Replies)
Discussion started by: thangadurai
2 Replies

6. Homework & Coursework Questions

File transfer from Red Hat Linux to Windows 7

My assignment is to use C++ to generate a table of values for the U.S. standard atmosphere, when data at sea level are given, which i have done perfectly. Now, i am attempting to create a matlab script to read and plot the data. I forgot to put my table of data on my thumb drive yesterday, and... (4 Replies)
Discussion started by: ds7202
4 Replies

7. UNIX for Dummies Questions & Answers

how to know if i use "Red Hat Enterprise Linux" or "Red Hat Desktop" ?

how to know if i use "Red Hat Enterprise Linux" or "Red Hat Desktop" ? (2 Replies)
Discussion started by: ahmedamer12
2 Replies

8. Shell Programming and Scripting

Directory / File changes on CIFS share mounted on Red Hat Linux

I have a requirement to copy the changed file on CIFS share mounted on Red Hat Linux to a remote FTP/SFTP server. I tried inotify-tools, but this didn't track the modified files. Has anyone tried incron or any other suggestion? (1 Reply)
Discussion started by: SupeAlok
1 Replies

9. Fedora

Which is the better platform to learn UNIX/Linux (Kali Linux Vs. Red Hat or other)?

I just started a new semester and I started my UNIX class yesterday. I've already decided to use python along with my learning process but what I really want to use with it is Kali as my UNIX/Linux platform to learn off of since I already wanted to learn Cyber Sec. anyways. I just wanted to know if... (12 Replies)
Discussion started by: ApacheOmega
12 Replies

10. Red Hat

Converting fixed width file to pipe delimiter in Linux(red-hat)

Hi, I am facing a typical scenario for AWK command . In HP- UNIX is behave as expected but in red hat linux same awk code is not give the same result. The below code is for convert the fixed width file to pipe delimiter file in HP-unix server. awk code: #!/bin/awk -f NR!=1... (11 Replies)
Discussion started by: brij_abhi
11 Replies
ADD(2)								System Calls Manual							    ADD(2)

NAME
add, sub, mul, div, raddp, rsubp, rmul, rdiv, rshift, inset, rcanon, eqpt, eqrect, ptinrect, rectinrect, rectXrect, rectclip, Dx, Dy, Pt, Rect, Rpt - arithmetic on points and rectangles SYNOPSIS
#include <u.h> #include <libc.h> #include <libg.h> Point add(Point p, Point q) Point sub(Point p, Point q) Point mul(Point p, int a) Point div(Point p, int a) Rectangle raddp(Rectangle r, Point p) Rectangle rsubp(Rectangle r, Point p) Rectangle rmul(Rectangle r, int a) Rectangle rdiv(Rectangle r, int a) Rectangle rshift(Rectangle r, int a) Rectangle inset(Rectangle r, int n) Rectangle rcanon(Rectangle r) int eqpt(Point p, Point q) int eqrect(Rectangle r, Rectangle s) int ptinrect(Point p, Rectangle r) int rectinrect(Rectangle r, Rectangle s) int rectXrect(Rectangle r, Rectangle s) int rectclip(Rectangle *rp, Rectangle b) int Dx(Rectangle r) int Dy(Rectangle r) Point Pt(int x, int y) Rectangle Rect(int x0, int y0, int x1, int y1) Rectangle Rpt(Point p, Point q) DESCRIPTION
The functions Pt, Rect and Rpt construct geometrical data types from their components. These are implemented as macros. Add returns the Point sum of its arguments: Pt(p.x+q.x, p.y+q.y). Sub returns the Point difference of its arguments: Pt(p.x-q.x, p.y-q.y). Mul returns the Point Pt(p.x*a, p.y*a). Div returns the Point Pt(p.x/a, p.y/a). Raddp returns the Rectangle Rect(add(r.min, p), add(r.max, p)); rsubp returns the Rectangle Rpt(sub(r.min, p), sub(r.max, p)). Rmul returns the Rectangle Rpt(mul(r.min,a), mul(r.max,a)); Rdiv returns the Rectangle Rpt(div(r.min,a), div(r.max,a)). Rshift returns the rectangle r with all coordinates either left-shifted or right-shifted by a, depending on whether a is positive or nega- tive, respectively. Inset returns the Rectangle Rect(r.min.x+n, r.min.y+n, r.max.x-n, r.max.y-n). Rcanon returns a rectangle with the same extent as r, canonicalized so that min.x <= max.x, and min.y <= max.y. Eqpt compares its argument Points and returns 0 if unequal, 1 if equal. Eqrect does the same for its argument Rectangles. Ptinrect returns 1 if p is a point within r, and 0 otherwise. Rectinrect returns 1 if all the pixels in r are also in s, and 0 otherwise. RectXrect returns 1 if r and s share any point, and 0 otherwise. Rectclip clips in place the Rectangle pointed to by rp so that it is completely contained within b. The return value is 1 if any part of *rp is within b. Otherwise, the return value is 0 and *rp is unchanged. The functions Dx and Dy give the width (x) and height (y) of a Rectangle. They are implemented as macros. SOURCE
/sys/src/libg SEE ALSO
graphics(2) ADD(2)
All times are GMT -4. The time now is 03:43 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy