Sponsored Content
Top Forums Shell Programming and Scripting script to tail file; problem with awk and special characters Post 302592585 by aigles on Tuesday 24th of January 2012 10:04:56 AM
Old 01-24-2012
Another way :
Code:
Last=0
while :
do
    Line=$(wc -l < moo.txt)
    awk "NR>$Last {p=1}p" moo.txt #pipe this to log analyzer program
    Last=$Line
    sleep 10
done

Jean-Pierre.
This User Gave Thanks to aigles For This Post:
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

awk/sed with special characters

i have this script that searches for a pattern. However it fails if the pattern includes some special characters. So far, it fails with the following strings: 1. -Cr 2. $Mj 3. H'412 would a sed or awk be more effective? i don't want the users to put the (\) during the search (they... (5 Replies)
Discussion started by: apalex
5 Replies

2. Shell Programming and Scripting

Handling special characters using awk

Hi all, How do I extract a value without special characters? I need to extract the value of %Used from below and if its greater than 80, need to send a notification. I am doing this right now..Its giving 17%..Is there a way to extract the value and assign it to a variable in one step? df |grep... (3 Replies)
Discussion started by: sam_78_nyc
3 Replies

3. HP-UX

utf-8, problem with special characters

Hi all, We are facing the following problem in our HP-UX machine: software that manipulates utf-8 encoded strings (e.g. during string cut), fails to correctly manipulate strings (all containing Greek characters) that contain special characters like @, &, # etc. Actually, in different... (3 Replies)
Discussion started by: alina
3 Replies

4. Shell Programming and Scripting

special characters giving problem

Hi All, I have a CSV file in which some fields contains special character for ex:- my file is file 1 cat file1 abcd,bgfht,ngbht,abvc **** hdlld,hsgdt,bhfy,knht **** whenever i am trying to put a 4th feild in a variable its giving me list of all the files i have in current... (6 Replies)
Discussion started by: sam25
6 Replies

5. Shell Programming and Scripting

awk print $1 escape all special characters

I'm using awk '{print $1}' and it works most of the time to print the contents of a mysql query loop, but occationally I get a field with some special character in it, is there a way to tell awk to ignore all special characters between my FS? I have >186K records, so building a list of ALL special... (6 Replies)
Discussion started by: unclecameron
6 Replies

6. Shell Programming and Scripting

Need HELP with AWK split. Need to check for "special characters" in string before splitting the file

Hi Experts. I'm stuck with the below AWK code where i'm trying to move the records containing any special characters in the last field to a bad file. awk -F, '{if ($NF ~ /^|^/) print >"goodfile";else print >"badfile"}' filename sample data 1,abc,def,1234,A * 2,bed,dec,342,* A ... (6 Replies)
Discussion started by: shell_boy23
6 Replies

7. Shell Programming and Scripting

Problem with Special characters in file

Hi, I am facing a below problem. Inorder to mak sure the below file is fixed width i am using the following command awk '{printf("%-375s\n", $0) } so as to add trailing spaces at the end for records of length less than 375. Input file > inp.txt 1©1234 1234 123©1 The output file is... (1 Reply)
Discussion started by: marcus_kosaman
1 Replies

8. Shell Programming and Scripting

Problem with special characters....

grep -i "$line,$opline" COMBO_JUNK|awk -F, ' { C4+=$4 } { } END { print C4 } ' OFS=,` when i run this command in the script.... it o/p all the value as 0 if $line contains any special parameters..... but the same script if i run in command prompt... it shows... (4 Replies)
Discussion started by: nikhil jain
4 Replies

9. Shell Programming and Scripting

awk conditions failing (special characters?)

This is really frustrating because I can't figure it out. I'm running a health check script. One of the items I'm checking is the amount of memory on a server. I use the free command, which outputs something like this (excerpt) Mem: 100 100 100 100 Swap: 100 100 100 100 In my debugging... (5 Replies)
Discussion started by: JustaDude
5 Replies

10. Shell Programming and Scripting

Handle special characters in awk -F

Hello Folks, Need to bisect strings based on a subset. Below works good. echo /a/b/c/d | awk -F"/c/d$" '{print $1}' /a/b However, it goes awry with special characters. echo /a/b/c+/d | awk -F"/c+/d$" '{print $1}' /a/b/c+/d Desired output: /a/b Escaping the special characters... (11 Replies)
Discussion started by: vibhor_agarwali
11 Replies
Geometry::Primitive::Line(3pm)				User Contributed Perl Documentation			    Geometry::Primitive::Line(3pm)

NAME
Geometry::Primitive::Line - A Line DESCRIPTION
Geometry::Primitive::Line represents a straight curve defined by two points. SYNOPSIS
use Geometry::Primitive::Line; my $line = Geometry::Primitive::Line->new(); $line->start($point1); $line->end($point2); ATTRIBUTES
end Set/Get the end point of the line. start Set/Get the start point of the line. METHODS
new Creates a new Geometry::Primitive::Line contains_point Returns true if the supplied point is 'on' the line. Accepts either a point object or an x y pair. grow Does nothing, as I'm not sure how. Patches or hints welcome. is_parallel ($other_line) Returns true if the supplied line is parallel to this one. is_perpendicular ($other_line) Returns true if the supplied line is perpendicular to this one. length Get the length of the line. point_end Get the end point. Provided for Shape role. point_start Get the start point. Provided for Shape role. scale Does nothing at the moment. slope Get the slope of the line. to_string Guess! y_intercept Returns the Y intercept of this line. AUTHOR
Cory Watson <gphat@cpan.org> COPYRIGHT &; LICENSE You can redistribute and/or modify this code under the same terms as Perl itself. perl v5.10.1 2010-01-10 Geometry::Primitive::Line(3pm)
All times are GMT -4. The time now is 07:13 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy