The UNIX and Linux Forums  


Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com



Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Unable to kill sleeping process stevefox Shell Programming and Scripting 0 10-30-2006 06:14 AM
How to wakeup sleeping processes stevefox Shell Programming and Scripting 11 10-25-2006 06:55 PM
sleeping less than a second Perderabo Answers to Frequently Asked Questions 0 09-14-2006 03:06 AM
Is there any thing like this perl command is csh? umen Shell Programming and Scripting 4 05-11-2006 03:49 PM
One line perl command rsg00usa Shell Programming and Scripting 2 12-14-2005 05:45 PM

 
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #1 (permalink)  
Old 03-03-2005
effigy's Avatar
effigy effigy is offline
Registered User
  
 

Join Date: Aug 2003
Location: IL, USA
Posts: 35
perl: sleeping during a command

hello everyone,

i am attempting to run the sleep function (i've also tried select) during the execution of a command to mimic a status. for example:

# this is a terminal screen
# here the process is executed
# below this a status is displayed while the command executes like so:
..................................................done


however, when i use sleep or select, they delay the command. how can i separate the two?

i have done this in shell scripts before using ps, grep, and awk; however, i'd like to pull this off in perl if possible...

here is what i have:


Code:
open CMD "$cmd |";
while(<CMD>) {
	print '.';
	# future code to log the output of CMD
	sleep 1;
	# select(undef, undef, undef, 0.5);
}


Last edited by effigy; 03-03-2005 at 10:49 PM..
 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 05:01 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0