Sponsored Content
Top Forums Shell Programming and Scripting Spaced input causing awk error Post 302582500 by whyte_rhyno on Friday 16th of December 2011 07:48:07 AM
Old 12-16-2011
Spaced input causing awk error

Hi all, Just want to say thanks for the great forum you have here, the old topics and posts have helped tremendously. So much so that I have managed to figure a lot out just by researching. However, I'm having a small issue that I simply can't find the answer to.

Last edited by whyte_rhyno; 12-30-2011 at 05:15 PM.. Reason: Forgot to mention what shell I'm using
 

10 More Discussions You Might Find Interesting

1. Solaris

Explorer causing syslog error

Hi there, I have upgraded my explorer (SUNWexplo) on a solaris 10 Sparc box from version 3.4 to the latest version (5.5) . However im a little concerned, whenever I run the new explorer either manually or scheduled, I get a syslog event as follows 1 in 0:08:31: Sep 22 17:00:15 fmy.machine.com... (8 Replies)
Discussion started by: hcclnoodles
8 Replies

2. Solaris

Memory error causing reboot

Hi there I have a box that at 4pm started recieving soft errors on a DIMM, normally this is ok and we have time to swap it out. But I got the following error which caused the box to reboot NOTE: there were abount 6 or 7 normal "soft error encountered" messages before this one Nov 7... (1 Reply)
Discussion started by: hcclnoodles
1 Replies

3. Linux

how to cut column that is not equally spaced by delimeters

hi friends, when i run this command on my machine; df -k /export/home output of this command i gets as: /Filesystem kbytes used avail capacity Mounted on /dev/dsk/c0t1d0s7 5043168 4520584 472153 91% /export/home i want to use column avail from above output: i... (1 Reply)
Discussion started by: johnray31
1 Replies

4. Shell Programming and Scripting

Sed and white spaced string problem

Consider a string with white space "abc 123" string="abc 123" echo $string abc 123 sed "s/$string/$string 456/" file abc 123 456 cat file abc 123 OK for now, but if you put this one in a shell script it gives the result: abc 456 123 somehow string end in first white space ?? ... (3 Replies)
Discussion started by: xramm
3 Replies

5. Shell Programming and Scripting

Awk script problem - Variables Causing Issue

can someone please explain to me what i'm doing wrong with this code: WELT=$(awk '(($1 ~ "^${caag}$") || ($2 ~ "^${caag}$"))' /tmp/Compare.TEXT) when run from the command line, it works. but it seems to be having a problem doing the comparison when variables are involved. i tested from... (1 Reply)
Discussion started by: SkySmart
1 Replies

6. Shell Programming and Scripting

Error Message in function causing failure.....

I have a long busybox ash script that has 3 stages. 1. Identify and Capture information on variable data sources, output the information to text file on each data source. 2. Using data from 1 above now actually do data processing on each individual dataset. 3. Produce report. So... (6 Replies)
Discussion started by: tesser
6 Replies

7. Shell Programming and Scripting

Help with FTP Script which is causing "syntax error: unexpected end of file" Error

Hi All, Please hav a look at the below peice of script and let me know if there are any syntax errors. i found that the below peice of Script is causing issue. when i use SFTP its working fine, but there is a demand to use FTP only. please find below code and explain if anything is wrong... (1 Reply)
Discussion started by: mahi_mayu069
1 Replies

8. Shell Programming and Scripting

Pipe causing last command error to not function

Hi I am quite new to scripting and cannot work out how to do the following - I want to pipe to a log file and then use the "last statement error" in an if statement after, and this doesn't work because it checks the pipe statement instead of the script. Example: executteTheScript $var |... (4 Replies)
Discussion started by: erjorgito
4 Replies

9. Shell Programming and Scripting

Percentage sign causing awk problems

looks like awk gets confused when there's a % next to a number. command im running: awk -F" " '/phxnaz001b/ && /vol/ && NF { if (($NF >= 80) && ($NF < 83)) { print ; print ; w++ } else if ($NF >= 83) { print ; c++ } } END { printf("%d:OK %d:WARNING %d:CRITICAL\n", o, w, c) }' /tmp/test.log ... (3 Replies)
Discussion started by: SkySmart
3 Replies

10. 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
TM::Graph(3pm)						User Contributed Perl Documentation					    TM::Graph(3pm)

NAME
TM::Graph - Topic Maps, trait for graph-like operations SYNOPSIS
use TM::Materialized::AsTMa; my $tm = new TM::Materialized::AsTMa (file => 'old_testament.atm'); $tm->sync_in; Class::Trait->apply ( $tm => 'TM::Graph' ); # find groups of topics connected print Dumper $tm->clusters; # use association types to compute a hull print "friends of Mr. Cairo: ". Dumper [ $tm->frontier ([ $tm_>tid ('mr-cairo') ], [ [ $tm->tids ('foaf') ] ]) ]; # see whether there is a link (direct print "I always knew it" if $tm->is_path ( [ 'gw-bush' ], # there could be more (bless [ [ 'foaf' ] ], '*'), 'osama-bin-laden'); DESCRIPTION
Obviously a topic map is also a graph, the topics being the nodes, and the associations forming the edges, albeit these connections connect not always only two nodes, but, ok, you should know TMs by now. This package provides some functions which focus more on the graph-like nature of Topic Maps. INTERFACE
Methods This trait provides the following methods: clusters $hashref = clusters ($tm) computes the islands of topics. It figures out which topics are connected via associations and - in case they are - will collate them into clusters. The result is a hash reference to a hash containing list references of topic ids organized in a cluster. In default mode, this function only regards topics to be in the same cluster if topics play roles in one and the same maplet. The role topics themselves or the type or the scope are ignored. You can change this behaviour by passing in options like use_scope => 1 use_roles => 1 use_type => 1 Obviously, with "use_scope => 1" you will let a lot of topics collapse into one cluster as most maplets usually are in the unconstrained scope. NOTE: This is yet a somewhat expensive operation. frontier @hull = $tm->frontier (@start_lids, $path_spec) This method computes a qualified hull, i.e. a list of all topics which are reachable from @start_lids via a path specified by $path_spec. The path specification is a (recursive) data structure, describing sequences, alternatives and repetition (the "*" operator), all encoded as lists of lists. The topics in that path specification are interpreted as assertion types. Example (reformatting for better reading): # a single step: start knows ... [ ] # outer level: sequence (there is only one) [ 'knows' ] # inner level: alternatives (there is only one) # two subsequent steps: start knows ... isa ... [ ] # outer level: two entries [ 'knows' ], [ 'isa' ] # inner level, one entry each # repetition: start knows ... knows ... knows ... ad infinitum bless [ ], '*' # outer level: one entry, but blessed [ 'knows' ] # inner level # alternatives: start knows | hates ... [ ] # outer level: one entry [ 'knows', 'hates' ] # inner level: alternatives # nesting: first follow an 'eats', then any number of 'begets' [ ] [ 'eats' ], [ ] bless [ ], '*' [ 'begets' ] NOTE: All tids have to be made map-absolute with "tids". NOTE: Cycles are detected. NOTE: I am not sure how this performs at rather large graphs, uhm, maps. is_path $bool = $tm->is_path (@start_lids, $path_spec, $end_lid) This method returns 1 if there is a path from start_lids to end_lid via the path specification. See frontier for that one. neighborhood @neighbors = $tm->neighborhood ($MAXDEPTH, @start_lids) This method returns a list of neighbors for the given start LIDs. In that it follows paths with the maximal length given as first parameter. In any case the path with length 0 is returned, which includes any of the starting nodes. Each neighbor is represented by a hash (reference) with the "path" and the "end" LID. The path is a list (reference) holding the LIDs of the association types visited along the path. SEE ALSO
TM COPYRIGHT AND LICENSE
Copyright 200[78] by Robert Barta, <drrho@cpan.org> This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself. perl v5.10.1 2010-04-05 TM::Graph(3pm)
All times are GMT -4. The time now is 05:18 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy