Sponsored Content
Top Forums UNIX for Dummies Questions & Answers Is there a way scroll text instead of page? Post 12248 by Perderabo on Saturday 22nd of December 2001 03:35:41 PM
Old 12-22-2001
Sleeping for less than a second is not a real good idea in a script. The overhead required to launch a process is too great. The right thing would be to switch to c. But it is easy to write a program like sleep that will sleep for less than a second if you want to give it a try. I wrote one that I call "nodoff". It sleeps for milliseconds. So "nodoff 500" is a half a second. Here it is...
Code:
#ifdef __STDC__
#define PROTOTYPICAL
#endif
#ifdef __cplusplus
#define PROTOTYPICAL
#endif

#include <stdlib.h>
#include <sys/time.h>

#ifdef PROTOTYPICAL
int main(int argc, char *argv[])
#else
main(argc,argv)
char *argv[];
#endif

{
        int millisecs, microsecs;
        struct timeval tv;

        millisecs=atoi(argv[1]);
        microsecs=millisecs*1000;

        tv.tv_sec=microsecs/1000000;
        tv.tv_usec=microsecs%1000000;

        select(0, NULL, NULL, NULL, &tv);
        exit(0);
}


Last edited by Perderabo; 01-16-2005 at 03:17 PM.. Reason: Remove html which is no longer supported
 

10 More Discussions You Might Find Interesting

1. Programming

Text Modification and page I/O error

Hi!, while launching my C application on HP-UX 10.2 workstation, I get the following error message sometime: Pid 9951 killed due to text modification or page I/O error Could someone tell me what does this error means?? and how is this caused? Thanx in Advance, JP (4 Replies)
Discussion started by: jyotipg
4 Replies

2. Shell Programming and Scripting

linking unix generated text file to html page

i am trying to link the text files that i generated from my shell script to an html page, to that i can view them using a browser, like internet explorer. i want to open the text files in html page when i enter a command to view the text file from the shell command. please could anyone help... (1 Reply)
Discussion started by: alexd
1 Replies

3. HP-UX

Pid X killed due to text modification or page I/O error

Hello everybody, I have a HP-UX B.11.11. I had one disk and added one new. When trying to configure the second disk Not Using the Logical Volume Manager(from SAM) I have this error: Pid X killed due to text modification or page I/O error I tryed to add another partion on the first disk,... (5 Replies)
Discussion started by: savus
5 Replies

4. Solaris

How to scroll through the man page in Solaris

Hey All, I generally login to the Solaris box using Putty. But when I read a man page, I am not being able to scroll line by line using traditional 'j' or 'k' keys. Any idea about how can we scroll through line by line while reading a manage page over Putty (2 Replies)
Discussion started by: paragkalra
2 Replies

5. UNIX for Dummies Questions & Answers

Possible to download web page's text to a file?

Hi, Say there is a web page that contains just text only - that is, even the source code is just the text itself, nothing more. An example would be "http://mynasadata.larc.nasa.gov/docs/ocean_percent.txt" Is there a UNIX command that would allow me to download this text and store it in a... (1 Reply)
Discussion started by: Breanne
1 Replies

6. Shell Programming and Scripting

Grep text matching problem with script which checks if web page contains text.

I wrote a Bash script which checks to see if a text string exists on a web page and then sends me an email if it does (or does not e.g. "Out of stock"). I run it from my crontab, it's quite handy from time to time and I've been using it for a few years now. The script uses wget to download an... (6 Replies)
Discussion started by: gencon
6 Replies

7. Shell Programming and Scripting

Web page with picture, text, php function

Hello. I'm trying to create a web page which the presentation is as follows: 1 °) at the top of page an image 2 °) below the text 3 °) to complete a php function that returns information. I tried different things but none work. Script 1: <!DOCTYPE html> <html> <head> <style> div { ... (5 Replies)
Discussion started by: jcdole
5 Replies

8. Shell Programming and Scripting

Copy text from web page and add to file

I need help to make a script for Ubuntu to OSCam that copy the text on this website that only contains "C: ip port randomUSERNAME password" and want to exclude the text "C:" and replace the rest with the old in my test.server file. (line 22) device = ip,port (line 23) user =... (6 Replies)
Discussion started by: baxarn
6 Replies

9. UNIX for Beginners Questions & Answers

Converting text file to html page

Hello Everyone, I have the following text file with the each field separated by newline Text file P file1-en-us_US-20170718T150157Z.json Wed 19 Jul 2017 06:10:13 AM EDT P file2-en-us_US-20170718T160150Z.json Wed 19 Jul 2017 06:10:13 AM EDT P file3-en-us_US-20170718T163218Z.json Wed... (9 Replies)
Discussion started by: nextStep
9 Replies

10. Forum Support Area for Unregistered Users & Account Problems

UZoo ad disabling scroll on page

The ad for UZoo disables scrolling. Very annoying (0 Replies)
Discussion started by: Unregistered
0 Replies
drv_usectohz(9F)					   Kernel Functions for Drivers 					  drv_usectohz(9F)

NAME
drv_usectohz - convert microseconds to clock ticks SYNOPSIS
#include <sys/types.h> #include <sys/ddi.h> clock_t drv_usectohz(clock_t microsecs); INTERFACE LEVEL
Architecture independent level 1 (DDI/DKI). PARAMETERS
microsecs The number of microseconds to convert. DESCRIPTION
drv_usectohz() converts a length of time expressed in microseconds to a number of system clock ticks. The time arguments to timeout(9F) and delay(9F) are expressed in clock ticks. drv_usectohz() is a portable interface for drivers to make calls to timeout(9F) and delay(9F) and remain binary compatible should the driver object file be used on a system with a different clock speed (a different number of ticks in a second). RETURN VALUES
The value returned is the number of system clock ticks equivalent to the microsecs argument. No error value is returned. If the clock tick equivalent to microsecs is too large to be represented as a clock_t, then the maximum clock_t value will be returned. CONTEXT
drv_usectohz() can be called from user or interrupt context. SEE ALSO
delay(9F), drv_hztousec(9F), timeout(9F) Writing Device Drivers SunOS 5.10 12 Nov 1992 drv_usectohz(9F)
All times are GMT -4. The time now is 08:27 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy