Sponsored Content
Top Forums UNIX for Dummies Questions & Answers while loop not taking the not equal to condition Post 302223216 by ssuresh1999 on Friday 8th of August 2008 03:41:25 PM
Old 08-08-2008
Thank you

Thank you all for helping me out mine was a just logic problem Smilie
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Problem taking input from file with for loop

I am trying to take input from a file and direct it into a bash script. This script is meant to be a foreach loop. I would like the script to process each item in the list one by one and direct the output to a file. # cat 1loop #!/bin/bash # this 2>&1 to redirect STDERR & STDOUT to file... (4 Replies)
Discussion started by: bash_in_my_head
4 Replies

2. Solaris

Infinite for loop is taking too much CPU usage %

Hi All, I wrote one simple for loop shell script which prints number..but this loop is infinite...but its taking lot of CPU (15.7) %. if i am using sleep cmd then cpu usage become 0.4 %. Is there anyway to reduce this CPU usage without using sleep cmd? i dont want 2 use sleep cmd... (7 Replies)
Discussion started by: pa.chidhambaram
7 Replies

3. Shell Programming and Scripting

For Loop Taking Too Long

I'm new from UNIX scripting. Please help. I have about 10,000 files from the $ROOTDIR/scp/inbox/string1 directory to compare with the 50 files from /$ROOTDIR/output/tma/pnt/bad/string1/ directory and it takes about 2 hours plus to complete the for loop. Is there a better way to re-write the... (5 Replies)
Discussion started by: hanie123
5 Replies

4. UNIX for Advanced & Expert Users

Comparison and For Loop Taking Too Long

I'd like to 1. Check and compare the 10,000 pnt files contains single record from the /$ROOTDIR/scp/inbox/string1 directory against 39 bad pnt files from the /$ROOTDIR/output/tma/pnt/bad/string1 directory based on the fam_id column value start at position 38 to 47 from the record below. Here is... (1 Reply)
Discussion started by: hanie123
1 Replies

5. Shell Programming and Scripting

if condition in a while loop

Gurus, I need to read a line from a file and strip the characters from it and compare the stripped value with the value I pass to the script while executing it. Below is the code for the same. But when i execute the code, it is throwing an error. #!/bin/ksh . /home/.i_env ... (14 Replies)
Discussion started by: svajhala
14 Replies

6. Shell Programming and Scripting

Use of -z in while loop condition

Hi, Could you please tell what is the meaning of -z in while loop condition. For example, while ; do echo "*** Enter the age " readage (3 Replies)
Discussion started by: vidyaj
3 Replies

7. Shell Programming and Scripting

If not equal to then loop

How do I go about amending this simple script that prompts for a yes/no response so that if neither Y or N are entered it will loop back back to the original prompt #!/bin/ksh echo "Enter yes of no" read answer if then echo "You selected yes" elif then echo "You selected no" elif... (5 Replies)
Discussion started by: gmears
5 Replies

8. Shell Programming and Scripting

grep not equal to condition

I have below files under dir_a and dir_b and i want to sort out number of dir_a and dir_b files seperately and if i do the grep it should retrun 2 files in dir_a and 1 file in dir_b. /dir_a/12345678 /dir_a/87654321 /dir_a/dir_b/12345687 But i am getting cat file|grep dir_a|wc -l 3... (6 Replies)
Discussion started by: prash358
6 Replies

9. Shell Programming and Scripting

While loop problem taking too long

while read myhosts do while read discovered do echo "$discovered" done < $LOGFILE | grep -Pi "|" | egrep... (7 Replies)
Discussion started by: SkySmart
7 Replies

10. Shell Programming and Scripting

Help with taking variable of for loop in textfile

Hi, I am new to unix/linux scripting. I have a text file, listlib.txt where the content: lib1_23 lib34_a ab_li_lab I need to generate a file (.log) of each cell. I am planning to create a (.csh) script that will have for loop with variable taken from listlib.txt. As for now, i have no... (4 Replies)
Discussion started by: mmaz
4 Replies
Object::Pluggable::Pipeline(3pm)			User Contributed Perl Documentation			  Object::Pluggable::Pipeline(3pm)

NAME
Object::Pluggable::Pipeline - The plugin pipeline for Object::Pluggable. SYNOPSIS
use Object::Pluggable; use Object::Pluggable::Pipeline; use My::Plugin; my $self = Object::Pluggable->new(); # the following operations are presented in pairs # the first is the general procedure, the second is # the specific way using the pipeline directly # to install a plugin $self->plugin_add(mine => My::Plugin->new); $self->pipeline->push(mine => My::Plugin->new); # to remove a plugin $self->plugin_del('mine'); # or the object $self->pipeline->remove('mine'); # or the object # to get a plugin my $plug = $self->plugin_get('mine'); my $plug = $self->pipeline->get('mine'); # there are other very specific operations that # the pipeline offers, demonstrated here: # to get the pipeline object itself my $pipe = $self->pipeline; # to install a plugin at the front of the pipeline $pipe->unshift(mine => My::Plugin->new); # to remove the plugin at the end of the pipeline my $plug = $pipe->pop; # to remove the plugin at the front of the pipeline my $plug = $pipe->shift; # to replace a plugin with another $pipe->replace(mine => newmine => My::Plugin->new); # to insert a plugin before another $pipe->insert_before(mine => newmine => My::Plugin->new); # to insert a plugin after another $pipe->insert_after(mine => newmine => My::Plugin->new); # to get the location in the pipeline of a plugin my $index = $pipe->get_index('mine'); # to move a plugin closer to the front of the pipeline $pipe->bump_up('mine'); # to move a plugin closer to the end of the pipeline $pipe->bump_down('mine'); DESCRIPTION
Object::Pluggable::Pipeline defines the Plugin pipeline system for Object::Pluggable instances. METHODS
"new" Takes one argument, the Object::Pluggable object to attach to. "push" Takes at least two arguments, an alias for a plugin and the plugin object itself. Any extra arguments will be passed to the register method of the plugin object. If a plugin with that alias already exists, $@ will be set and "undef" will be returned. Otherwise, it adds the plugin to the end of the pipeline and registers it. This will yield a "plugin_add" event. If successful, it returns the size of the pipeline. my $new_size = $pipe->push($name, $plug, @register_args); "unshift" Takes at least two arguments, an alias for a plugin and the plugin object itself. Any extra arguments will be passed to the register method of the plugin object. If a plugin with that alias already exists, $@ will be set and "undef" will be returned. Otherwise, it adds the plugin to the beginning of the pipeline and registers it. This will yield a "plugin_add" event. If successful, it returns the size of the pipeline. my $new_size = $pipe->push($name, $plug, @register_args); "shift" Takes any number of arguments. The first plugin in the pipeline is removed. Any arguments will be passed to the unregister method of the plugin object. This will yield a "plugin_del" event. In list context, it returns the plugin and its alias; in scalar context, it returns only the plugin. If there were no elements, an empty list or "undef" will be returned. my ($plug, $name) = $pipe->shift(@unregister_args); my $plug = $pipe->shift(@unregister_args); "pop" Takes any number of arguments. The last plugin in the pipeline is removed. Any arguments will be passed to the unregister method of the plugin object. This will yield an "plugin_del" event. In list context, it returns the plugin and its alias; in scalar context, it returns only the plugin. If there were no elements, an empty list or "undef" will be returned. my ($plug, $name) = $pipe->pop(@unregister_args); my $plug = $pipe->pop(@unregister_args); "replace" Takes at least three arguments, the old plugin or its alias, an alias for the new plugin and the new plugin object itself. You can optionally pass two array references of arguments which will be delivered to the unregister method of the old plugin and the register method of the new plugin, respectively. If you only want to pass the latter, you can put "undef" in place of the former. If the old plugin doesn't exist, or if there is already a plugin with the new alias (besides the old plugin), $@ will be set and "undef" will be returned. Otherwise, it removes the old plugin (yielding an "plugin_del" event) and replaces it with the new plugin. This will yield an "plugin_add" event. If successful, it returns 1. my $success = $pipe->replace($name, $new_name, $new_plug, @unregister_args, @register_args); my $success = $pipe->replace($plug, $new_name, $new_plug, @unregister_args, @register_args); "insert_before" Takes at least three arguments, the plugin that is relative to the operation, an alias for the new plugin and the new plugin object itself. Any extra arguments will be passed to the register method of the new plugin object. If the first plugin doesn't exist, or if there is already a plugin with the new alias, $@ will be set and "undef" will be returned. Otherwise, the new plugin is placed just prior to the other plugin in the pipeline. If successful, it returns 1. my $success = $pipe->insert_before($name, $new_name, $new_plug, @register_args); my $success = $pipe->insert_before($plug, $new_name, $new_plug, @register_args); "insert_after" Takes at least three arguments, the plugin that is relative to the operation, an alias for the new plugin and the new plugin object itself. any extra arguments will be passed to the register method of the new plugin object. If the first plugin doesn't exist, or if there is already a plugin with the new alias, $@ will be set and "undef" will be returned. Otherwise, the new plugin is placed just after to the other plugin in the pipeline. If successful, it returns 1. my $success = $pipe->insert_after($name, $new_name, $new_plug, @register_args); my $success = $pipe->insert_after($plug, $new_name, $new_plug, @register_args); "bump_up" Takes one or two arguments, the plugin or its alias, and the distance to bump the plugin. The distance defaults to 1. If the plugin doesn't exist, $@ will be set and -1 will be returned, not undef. Otherwise, the plugin will be moved the given distance closer to the front of the pipeline. A warning is issued alerting you if it would have been moved past the beginning of the pipeline, and the plugin is placed at the beginning. If successful, the new index of the plugin in the pipeline is returned. my $pos = $pipe->bump_up($name); my $pos = $pipe->bump_up($plug); my $pos = $pipe->bump_up($name, $delta); my $pos = $pipe->bump_up($plug, $delta); "bump_down" Takes one or two arguments, the plugin or its alias, and the distance to bump the plugin. The distance defaults to 1. If the plugin doesn't exist, $@ will be set and -1 will be returned, not "undef". Otherwise, the plugin will be moved the given distance closer to the end of the pipeline. A warning is issued alerting you if it would have been moved past the end of the pipeline, and the plugin is placed at the end. If successful, the new index of the plugin in the pipeline is returned. my $pos = $pipe->bump_down($name); my $pos = $pipe->bump_down($plug); my $pos = $pipe->bump_down($name, $delta); my $pos = $pipe->bump_down($plug, $delta); "remove" Takes at least one argument, a plugin or its alias. Any arguments will be passed to the unregister method of the plugin object. If the plugin doesn't exist, $@ will be set and "undef" will be returned. Otherwise, the plugin is removed from the pipeline. This will yield an "plugin_del" event. In list context, it returns the plugin and its alias; in scalar context, it returns only the plugin. my ($plug, $name) = $pipe->remove($the_name, @unregister_args); my ($plug, $name) = $pipe->remove($the_plug, @unregister_args); my $plug = $pipe->remove($the_name, @unregister_args); my $plug = $pipe->remove($the_plug, @unregister_args); "get" Takes one argument, a plugin or its alias. If no such plugin exists, $@ will be set and "undef" will be returned. In list context, it returns the plugin and its alias; in scalar context, it returns only the plugin. my ($plug, $name) = $pipe->get($the_name); my ($plug, $name) = $pipe->get($the_plug); my $plug = $pipe->get($the_name); my $plug = $pipe->get($the_plug); "get_index" Takes one argument, a plugin or its alias. If no such plugin exists, $@ will be set and -1 will be returned, not "undef". Otherwise, the index in the pipeline is returned. my $pos = $pipe->get_index($name); my $pos = $pipe->get_index($plug); BUGS
None known so far. AUTHOR
Jeff "japhy" Pinyan, japhy@perlmonk.org. MAINTAINER
Chris "BinGOs" Williams, chris@bingosnet.co.uk. SEE ALSO
Object::Pluggable. POE::Component::IRC, perl v5.10.1 2010-10-09 Object::Pluggable::Pipeline(3pm)
All times are GMT -4. The time now is 07:00 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy