06-16-2008
Thanks
Hi era,
Just wanted to thank you for the help on the Endless Loop problem I posted a week or so ago. Your solution:
"The echo $filename before the do statement causes the while to examine the exit code of the echo, which is always true. You presumably want to move it after the do"
SOLVED the problem. Thanks so much.
Jeff R
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
I need a quick script that will serve as a sort of "real time monitor" for watching some log files. I am using Bourne shell in HP-UX 10.20. I have basically created a script that never ends, unless of course I manually terminate it. Here's the script (it's called qhistory):
clear
echo "REAL... (3 Replies)
Discussion started by: cdunavent
3 Replies
2. HP-UX
Hi
I've set up a remote IP-addressed printer using lpadmin on a hp-ux server. It is - as far as I can tell - identical to another printer on the system of the same model type. The default printer works fine with the lp command; the new printer sends endless copies and the job has to be cancelled... (2 Replies)
Discussion started by: ewans
2 Replies
3. Shell Programming and Scripting
I have about 5000 columns of data that i need to convert all of it into pecentages. for shorter colums i have been using this code:
{print $1/($1+$2)*100,$2/($1+$2),$3/($3+$4)*100 .....}
but this is a teadious process... is there anyway to do it without having to write all of them out?
sample... (20 Replies)
Discussion started by: chronicx
20 Replies
4. Shell Programming and Scripting
Hi,
PHP user here. I'm using an endless loop to perform to mimic a cron. The script does something every 20 minutes. It sleep()s in the meantime.
I have various checks that ensure that only instance can run, including a "gentleman agreement" locked file.
However, I'd like to make sure... (2 Replies)
Discussion started by: jjshell
2 Replies
5. Shell Programming and Scripting
When finding a string in files within a directory, one can use this:
grep -r "searchstring" dir/subdir/ > listofoccurrences.txt
For brevity sake one can enter the intended directory and use this:
grep -r "searchstring" . > listofoccurrences.txt
which as I found out leads to an endless loop,... (2 Replies)
Discussion started by: figaro
2 Replies
6. Shell Programming and Scripting
First time post. I did a search so I didn’t see this specific issue. It seems to be a head scratcher for me.
I have an hourly job that on rare occasions, gets into an endless loop.
I’ve tried different scenarios but the current version does basically the following.
Find all the *.arc files and... (18 Replies)
Discussion started by: Sylvan303
18 Replies
7. Shell Programming and Scripting
Hi All,
I've written a script to read 2 files and compare the contents using while loop but somehow when $line is not found in test2, the script will continue looping.
Below is my code, pls advise what could went wrong
TIA
Nick
for line in test1.txt | while read line
do
grep -i... (4 Replies)
Discussion started by: Nick1971
4 Replies
8. Shell Programming and Scripting
Here's my code:
awk -F '' 'NR==FNR {
if (/time/ && $5>10)
A=$2" "$3":"$4":"($5-01)
else if (/time/ && $5<01)
A=$2" "$3":"$4-01":"(59-$5)
else if (/time/ && $5<=10)
A=$2" "$3":"$4":0"($5-01)
else if (/close/) {
B=0
n1=n2;
... (2 Replies)
Discussion started by: klane
2 Replies
9. Shell Programming and Scripting
Hi,
AM very new to shell scripting and try to run a simple do while loop statement, but it ends up running endlessly. please can anyone assist, dunno what am doing wrong, any useful suggestions will be welcomed.
#!/bin/ksh
### To check a running process instance
#################... (5 Replies)
Discussion started by: bayoo
5 Replies
10. UNIX for Beginners Questions & Answers
I was practicing writing simple loops as I am a new bash user and I created this script, which turned out to be an endless loop where the echo output does not stop and I do not see where my mistake is.
#!/bin/bash
echo 'enter a number from 1 to 100'
read number
while
do
... (2 Replies)
Discussion started by: goldenlinx
2 Replies
LEARN ABOUT DEBIAN
io::async::loop::glib
IO::Async::Loop::Glib(3pm) User Contributed Perl Documentation IO::Async::Loop::Glib(3pm)
NAME
"IO::Async::Loop::Glib" - use "IO::Async" with Glib or GTK
SYNOPSIS
use IO::Async::Loop::Glib;
my $loop = IO::Async::Loop::Glib->new();
$loop->add( ... );
...
# Rest of GLib/Gtk program that uses GLib
Glib::MainLoop->new->run();
Or
$loop->loop_forever();
Or
while(1) {
$loop->loop_once();
}
DESCRIPTION
This subclass of "IO::Async::Loop" uses the "Glib::MainLoop" to perform read-ready and write-ready tests.
The appropriate "Glib::IO" sources are added or removed from the "Glib::MainLoop" when notifiers are added or removed from the set, or when
they change their "want_writeready" status. The callbacks are called automatically by Glib itself; no special methods on this loop object
are required.
CONSTRUCTOR
$loop = IO::Async::Loop::Glib->new()
This function returns a new instance of a "IO::Async::Loop::Glib" object. It takes no special arguments.
METHODS
There are no special methods in this subclass, other than those provided by the "IO::Async::Loop" base class.
$count = $loop->loop_once( $timeout )
This method calls the "iteration()" method on the underlying "Glib::MainContext". If a timeout value is supplied, then a Glib timeout will
be installed, to interrupt the loop at that time. If Glib indicates that any callbacks were fired, then this method will return 1 (however,
it does not mean that any "IO::Async" callbacks were invoked, as there may be other parts of code sharing the Glib main context. Otherwise,
it will return 0.
SEE ALSO
o Glib - Perl wrappers for the GLib utility and Object libraries
o Gtk2 - Perl interface to the 2.x series of the Gimp Toolkit library
AUTHOR
Paul Evans <leonerd@leonerd.org.uk>
perl v5.14.2 2013-03-01 IO::Async::Loop::Glib(3pm)