Sponsored Content
Full Discussion: POSIX compliance...
Operating Systems OS X (Apple) POSIX compliance... Post 302976888 by wisecracker on Thursday 7th of July 2016 03:56:42 PM
Old 07-07-2016
Well I have been experimenting with sleep <secs> to give me a smaller time accurate to about + or - 5mS on this MacBook Pro, OSX 10.7.5.

It would be good enough for the Egg_Timer.sh and passes the ShellCheck test.

It is fully posix compliant with SLEEPs unity seconds timer only.

Boy am I gonna get some flak over this one, (yes I bend the rules a little)... ;o)
Code:
#!/bin/sh
# delay.sh <secs> <millisecs[0-999]>
secs="$1"
millisecs=$( awk -v mS="$2" -v correction=0.94 ' BEGIN { print (( mS / 2 ) * correction ); } ' )
millisecs="${millisecs%.*}"

# Accuracy on my MBP OSX 10.7.5 + or - 5mS of FSD.
mS()
{
	loop=0
	while [ "$loop" -le "$millisecs" ]
	do
		sleep 0
		wait
		loop=$(( loop + 1 ))
	done
}
# Test the mS function only.
time mS
sleep "$secs"

As I quoted in a previous post I could create a resonably accurate timer using 'afplay', 'aplay' or '/dev/dsp'. I might use afplay and make it Apple dedicated...

Thanks Don for the info...

I await the flak... ;o)
 

5 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

sudo & Sox compliance

Hello, I am trying to convince my boss to stop allowing our users to login as root (superuser). Currently our users login to our unix server with their own account, then as needed, they will do an su and put in the root password. This scares me, for a bunch of reasons. Mainly, one is that we... (1 Reply)
Discussion started by: rwallaceisg
1 Replies

2. UNIX for Dummies Questions & Answers

man synopsis standard compliance

In different online sources, I found bits and pieces of information about those square and angular brackets and pipes. From what I have read, I can conclude it looks like this: 1. Options outside any brackets are mandatory 2. Options inside these < .. > are mandatory too 3. Options inside ... (4 Replies)
Discussion started by: vkleban
4 Replies

3. Cybersecurity

PCI DSS Compliance : Insecure Communication Has Been Detected

From the nessus scanner tool report i got below vulnerability PCI DSS Compliance : Insecure Communication Has Been Detected http://www.tenable.com/plugins/index.php?view=single&id=56208 As per the description given in above link - I am not able to understand How to find insecure port... (2 Replies)
Discussion started by: saurabh84g
2 Replies

4. Red Hat

Looking for PCI Compliance tool for Redhat Lix.

Hi i am in new to Linux world . I have been assigned to a project to find out a tool that will fulfill the PCI compliance for Linux servers for Audit process. anyone have any recommendation on that. Do Rad hat have any native application or plug-ins which we can use for that. (1 Reply)
Discussion started by: sahasuman
1 Replies

5. HP-UX

Password compliance setting

I need to set password compliance for some servers in my company. However, the requirements are that we need to set different password policies for 3 different user groups within the company. These are : System Users: i.e root, etc Batch/Application Users: oracle, bscs, etc Standard User:... (0 Replies)
Discussion started by: anaigini45
0 Replies
TERMSAVER(1)															      TERMSAVER(1)

NAME
Termsaver - A simple text-based terminal screensaver SYNTAX
termsaver [SCREEN] [OPTIONS] DESCRIPTION
is a simple alternative for simulating command-line based screensavers right on the terminal, in text-based format. To start the screensaver, execute Termsaver command with proper options as described in detail below, and to close it, just use the stan- dard Ctrl+C to interrupt it (or close the terminal window if you are on a desktop environment and no longer need it). SCREEN
The Termsaver application, to work properly, requires a screen as argument, which represents the name of the screensaver to be loaded. Each in turn, will have its own set of optional arguments, documented in its help option. Here follows a list of currently available screens (note that this information might become outdated if updates are not fully documented here, so always rely on the help option to display all screens available): quotes4all displays recent quotes from quotes4all.net asciiartfarts displays ascii images from asciiartfarts.com (NSFW) rssfeed displays rss feed information clock displays a digital clock on screen randtxt displays word in random places on screen dot displays a random running dot rfc randomly displays RFC contents programmer displays source code in typing animation urlfetcher displays url contents with typing animation jokes4all displays recent jokes from jokes4all.net (NSFW) matrix displays a matrix movie alike screensaver Refer to help option for additional information for each screen usage and example. OPTIONS
This program follow the usual GNU command line syntax, with long options starting with two dashes (`-'). A summary of options is included below. -h, --help Displays this help message -v, --verbose Displays python exception errors (for debugging) EXAMPLES
Check all available screens to use: termsaver --help Run random text screensaver with extra arguments: termsaver randtxt --word HelloWorld --delay 1 SEE ALSO
See more information about this project at: http://termsaver.info COPYRIGHT
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. AUTHORS
Termsaver was written by Bruno Braga <bruno.braga@gmail.com>. BUGS
Report bugs to authors at: http://github.com/brunobraga/termsaver Termsaver 22 March 2012 TERMSAVER(1)
All times are GMT -4. The time now is 11:50 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy