04-30-2017
The 'read' statement will more than likely be your Achilles Heel...
read -r -n 1 -s -t .025 key
You can't use a floating point time out timer on the pre-version 4.x.x read statement.
If you use -t 0 for your whole number timer then the keystroke does NOT get put into the 'key' variable. It does get sent to 'stdout' but that is useless.
So the minimum value for your game to work is '-t 1' which is 1 second.
I don't think there is a workaround using inkey() { char="" ; stty -icanon min 0 time 1 ; char=$( dd count=1 2> /dev/null ) ; } either.
(Thanks to Corona688 for showing me this method a few years back.)
9 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi all,
I'm not sure but I guess, that is a bash version issue.
The script working fine on "GNU bash, version 3.2.25(1)-release Ubuntu".
#!/bin/bash
while IFS=">" read a id val
do
if ]
then
VAL=${id%<*}; ID=${id#*</}
echo $VAL
echo $ID
sed... (5 Replies)
Discussion started by: research3
5 Replies
2. UNIX for Advanced & Expert Users
Hi,
I have a path like this c:\test\sample\programs, i need to change thiis to c:\\test\\sample\\programs. How to perform this? I tried tr command but it didn't help me.
Thanks
Vijayan (3 Replies)
Discussion started by: mvictorvijayan
3 Replies
3. Shell Programming and Scripting
Hi All,
The below code works perfectly on AIX machine but doesnt give the desired o/p on HP UX.
Can someone please generalise the code so that it becomes platform independent.
awk 'NR == FNR {
/^*\47name/ && c++ # get the field number
if (/^*\47size/) {
split($0, t, ":") ... (2 Replies)
Discussion started by: subhrap.das
2 Replies
4. Linux
Dear All,
Currently I am using montavista CGE-3.1 and JRE-1.4.2, now I like to upgrade CGE version-3.1 to CGE version-5.1. I like to know whether CGE-5.1 will support JRE-1.4.2 ?.
Kindly help in this regards.
Raj. (1 Reply)
Discussion started by: rajamohan
1 Replies
5. SCO
Hi
How to increase maximum number of open file in "sco xenix binary" running in "sco unix openserver 5.0.7" ?
I have changed "NOFILES" kernel parameter to 512, but xenix binray can't open more than 60.
tnx (4 Replies)
Discussion started by: javad1_maroofi
4 Replies
6. Solaris
Dear All,
Need your advise.
Can the Sun Fire V240 or Sun Fire V440 support with IPv6? Or it was depend to the OS? Any supporting document i can refer?
Thank for help (0 Replies)
Discussion started by: pcw
0 Replies
7. Programming
Actually I have installed python 3.2.
It seems there are a lot of synta variance between 2.2 and 3.2.
Is it possible to run a script in 2.2 without actually installing 2.2.
But I have installed 3.2.
and also is it possible to access the 2.2 shell in 3.2 version.
I am naive in python .
Please... (1 Reply)
Discussion started by: pandeesh
1 Replies
8. Shell Programming and Scripting
Hi i am having a stange problem.
Basically for my sed script used within bash i can unly use a single Quote with sed '. (if i use " then i get command garbled error with sed )
The problem with this is BASH does not interprit variables within single quote ' so we cannot use any of the BASH... (7 Replies)
Discussion started by: vash
7 Replies
9. Shell Programming and Scripting
Firstly, I would like to apologize if this is not the appropriate sub-forum to post about GNU/BSD makefile scripting. Though my code is in C++, because I am focusing on the makefile I thought it would go better in shell scripting. Please correct me if I am wrong.
Secondly, I am not interested in... (0 Replies)
Discussion started by: AntumDeluge
0 Replies
LEARN ABOUT SUNOS
wsreg_get_compatible_versions
wsreg_add_compatible_version(3WSREG) Product Install Registry Library Functions wsreg_add_compatible_version(3WSREG)
NAME
wsreg_add_compatible_version, wsreg_remove_compatible_version, wsreg_get_compatible_versions - add or remove a backward-compatible version
SYNOPSIS
cc [flag ...] file ...-lwsreg [library ...]
#include <wsreg.h>
int wsreg_add_compatible_version(Wsreg_component *comp, const char *version);
int wsreg_remove_compatible_version(Wsreg_component *comp, const char *version);
char **wsreg_get_compatible_versions(const Wsreg_component *comp);
DESCRIPTION
The wsreg_add_compatible_version() function adds the version string specified by version to the list of backward-compatible versions con-
tained in the component specified by comp.
The wsreg_remove_compatible_version() function removes the version string specified by version from the list of backward-compatible ver-
sions contained in the component specified by comp.
The wsreg_get_compatible_versions() function returns the list of backward-compatible versions contained in the component specified by comp.
RETURN VALUES
The wsreg_add_compatible_version() function returns a non-zero value if the specified backward-compatible version was successfully added;
otherwise, 0 is returned.
The wsreg_remove_compatible_version() function returns a non-zero value if the specified backward-compatible version was successfully
removed; otherwise, 0 is returned.
The wsreg_get_compatible_versions() function returns a null-terminated array of char pointers that represents the specified component's
list of backward-compatible versions. If the specified component has no such versions, NULL is returned. The resulting array and its con-
tents must be released by the caller.
USAGE
The list of backward compatible versions is used to allow components that are used by multiple products to upgrade successfully without
compromising any of its dependent products. The installer that installs such an update can check the list of backward-compatible versions
and look at what versions are required by all of the dependent components to ensure that the upgrade will not result in a broken product.
ATTRIBUTES
See attributes(5) for descriptions of the following attributes:
+-----------------------------+-----------------------------+
| ATTRIBUTE TYPE | ATTRIBUTE VALUE |
+-----------------------------+-----------------------------+
|MT-Level |Unsafe |
+-----------------------------+-----------------------------+
SEE ALSO
prodreg(1M), wsreg_initialize(3WSREG), wsreg_register(3WSREG), wsreg_set_version(3WSREG), attributes(5)
SunOS 5.10 22 Sep 2000 wsreg_add_compatible_version(3WSREG)