Sponsored Content
Top Forums UNIX for Dummies Questions & Answers Acting on results from a grep command Post 302480217 by crunchie on Tuesday 14th of December 2010 08:52:55 AM
Old 12-14-2010
Thanks guys that really helped Smilie
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

diffrent results between command line and scripted grep

When I type a command at the command line it supplies one result and the exact same command in a script egrep '^01|^02|^03|^04' file > fileout count = 29353 same count in the script yields a count of 23492 is there any reason this could be happening. (1 Reply)
Discussion started by: r1500
1 Replies

2. UNIX for Dummies Questions & Answers

List grep results

Hi I need to search for matching strings in a database and I want to print out all files that matches in "detail", which means that I want the output to contain datum of last saving. I only get the grep function tp print the actual file names which is not enough since the database is to large... (14 Replies)
Discussion started by: slire
14 Replies

3. UNIX for Dummies Questions & Answers

My ps -ef|grep command results are chopped off

On our one HP-UX 11i box, we have some very long paths defined. When I want to check on our user processes running, the resulting paths are chopped off. /xyz/abc/123/......./server/b is really a process running in the ..../server/bin directory. Is this a terminal problem or buffer length... (1 Reply)
Discussion started by: bsp18974
1 Replies

4. UNIX for Dummies Questions & Answers

Pipe results of Grep Command to LS Comand

I'm using the command grep -l XYZ to get a list of files containing the string XYZ. Then I using the comand ls -l ABC to get the create date timestamp of the each file. I've tried combining the comands using the pipe command, grep -l XYZ | ls -l, but its not working. What am I doing wrong? (3 Replies)
Discussion started by: jhtate
3 Replies

5. Shell Programming and Scripting

Grep no results

Hello guys, I have been looking around but can't find the answer to my problem: If the grep command displays no results, print "no results have been found" and increment x. But if the grep command find something, do nothing. if echo "no results have been found $x" x=`expr $x + 1 `... (3 Replies)
Discussion started by: Benou
3 Replies

6. Shell Programming and Scripting

How to analyse results of grep

Hi all, I'm working with a peice of software that runs on Linux that allows planning trips in cars through maps. This software has different variations depending on the type of car, e.g. BMW, Audi, Hyundai, etc... Each variation has a dependency on common external components that are not... (1 Reply)
Discussion started by: emoshaya
1 Replies

7. Shell Programming and Scripting

Read command acting erratically

I have been trying to use read in a script with issues so I tried some things on the command line. $ echo "testing 123" | read x ; echo $xand $ echo "testing 123" | read -r x ; echo $xare only producing any output after being invoked the first time after rebooting the machine. I also got into... (14 Replies)
Discussion started by: Michael Stora
14 Replies

8. Shell Programming and Scripting

How to concatenate grep results?

hi, let's say we have input in files test1.txt, test2.txt, text3.txt ... ... ... ('...' means more files & lines not just 'dots') test1.txt has: A B C D ... ... ... test2.txt has A B C D ... ... ... (4 Replies)
Discussion started by: msonoth
4 Replies

9. Shell Programming and Scripting

Cannot get results from grep command

Hi, i have a file hello.log which as several line that look like the below 2015-12-07 09:46:56 0:339 120.111.12.12 POST /helloWorld 2015-12-07 09:46:57 0:439 122.111.12.12 POST /helloWorld .... when i grep expecting to see results like the below. ... (6 Replies)
Discussion started by: mohtashims
6 Replies

10. UNIX for Beginners Questions & Answers

Grep command to show the number of results

Hi I wanted to know if there is an option in grep command to show the number of results (not the number of lines of findings). Thanks (14 Replies)
Discussion started by: abdossamad2003
14 Replies
Wiki::Toolkit::Plugin::Locator::Grid(3pm)		User Contributed Perl Documentation		 Wiki::Toolkit::Plugin::Locator::Grid(3pm)

NAME
Wiki::Toolkit::Plugin::Locator::Grid - A Wiki::Toolkit plugin to manage co-ordinate data. DESCRIPTION
Access to and calculations using co-ordinate metadata supplied to a Wiki::Toolkit wiki when writing a node. Note: This is read-only access. If you want to write to a node's metadata, you need to do it using the "write_node" method of Wiki::Tool- kit. We assume that the points are located on a flat, square grid with unit squares of side 1 metre. SYNOPSIS
use Wiki::Toolkit; use Wiki::Toolkit::Plugin::Locator::Grid; my $wiki = Wiki::Toolkit->new( ... ); my $locator = Wiki::Toolkit::Plugin::Locator::Grid->new; $wiki->register_plugin( plugin => $locator ); $wiki->write_node( "Jerusalem Tavern", "A good pub", $checksum, { x => 531674, y => 181950 } ) or die "argh"; # Just retrieve the co-ordinates. my ( $x, $y ) = $locator->coordinates( node => "Jerusalem Tavern" ); # Find the straight-line distance between two nodes, in metres. my $distance = $locator->distance( from_node => "Jerusalem Tavern", to_node => "Calthorpe Arms" ); # Find all the things within 200 metres of a given place. my @others = $locator->find_within_distance( node => "Albion", metres => 200 ); # Maybe our wiki calls the x and y co-ordinates something else. my $locator = Wiki::Toolkit::Plugin::Locator::Grid->new( x => "os_x", y => "os_y", ); METHODS
new # By default we assume that x and y co-ordinates are stored in # metadata called "x" and "y". my $locator = Wiki::Toolkit::Plugin::Locator::Grid->new; # But maybe our wiki calls the x and y co-ordinates something else. my $locator = Wiki::Toolkit::Plugin::Locator::Grid->new( x => "os_x", y => "os_y", ); x_field my $x_field = $locator->x_field; An accessor, returns the name of the metadata field used to store the x-coordinate. y_field my $y_field = $locator->y_field; An accessor, returns the name of the metadata field used to store the y-coordinate. coordinates my ($x, $y) = $locator->coordinates( node => "Jerusalem Tavern" ); Returns the x and y co-ordinates stored as metadata last time the node was written. distance # Find the straight-line distance between two nodes, in metres. my $distance = $locator->distance( from_node => "Jerusalem Tavern", to_node => "Calthorpe Arms" ); # Or in kilometres, and between a node and a point. my $distance = $locator->distance( from_x => 531467, from_y => 183246, to_node => "Duke of Cambridge", unit => "kilometres" ); Defaults to metres if "unit" is not supplied or is not recognised. Recognised units at the moment: "metres", "kilometres". Returns "undef" if one of the endpoints does not exist, or does not have both co-ordinates defined. The "node" specification of an end- point overrides the x/y co-ords if both specified (but don't do that). Note: Works to the nearest metre. Well, actually, calls "int" and rounds down, but if anyone cares about that they can send a patch. find_within_distance # Find all the things within 200 metres of a given place. my @others = $locator->find_within_distance( node => "Albion", metres => 200 ); # Or within 200 metres of a given location. my @things = $locator->find_within_distance( x => 530774, y => 182260, metres => 200 ); Units currently understood: "metres", "kilometres". If both "node" and "x"/"y" are supplied then "node" takes precedence. Croaks if insufficient start point data supplied. SEE ALSO
* Wiki::Toolkit * OpenGuides - an application that uses this plugin. AUTHOR
Kake Pugh (kake@earth.li). The Wiki::Toolkit team (http://www.wiki-toolkit.org/) COPYRIGHT
Copyright (C) 2004 Kake L Pugh. All Rights Reserved. Copyright (C) 2006 the Wiki::Toolkit Team. All Rights Reserved. This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself. CREDITS
This module is based heavily on (and is the replacement for) Wiki::Toolkit::Plugin::Locator::UK. The following thanks are due to people who helped with Wiki::Toolkit::Plugin::Locator::UK: Nicholas Clark found a very silly bug in a pre- release version, oops :) Stephen White got me thinking in the right way to implement "find_within_distance". Marcel Gruenauer helped me make "find_within_distance" work properly with postgres. perl v5.8.8 2007-10-23 Wiki::Toolkit::Plugin::Locator::Grid(3pm)
All times are GMT -4. The time now is 12:45 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy