08-21-2013
The question is nonsense. A program can ask for as much, or as little, as it needs to, and the amount it actually it gets may be equal to or less than that -- subject to things like interrupts and end-of-file.
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
I would really like to have a script that will accept the key press from the user with out having to press the enter key afterwards.
i.e.
echo "Press Y to print \c"
read YesNo
At this point the user has to press the enter key to continue. Is there a way to accept the key press from the... (3 Replies)
Discussion started by: jagannatha
3 Replies
2. UNIX for Dummies Questions & Answers
Hello,
I have a file where I am supposed to convert all the single i characters to uppercase, but when I try, it converts all the i's inside of words to uppercase as well.
I tried doing:
cat filename | sed 's/i/I/g'
but that obviously does not work.
Any help would be greatly... (6 Replies)
Discussion started by: zlindner
6 Replies
3. Shell Programming and Scripting
Hi all,
I have what I would have thought was a very simple problem but I can' find an elegant solution.
I have a file which has a single value you in it, say 194. All I want my perl script to do is open the file, read the value and assign that value to a variable.
I've done stuff like... (1 Reply)
Discussion started by: Donkey25
1 Replies
4. Shell Programming and Scripting
Hello,
I need to replace the comma to something else between the single quote:
1aaa,bbb,'cc,cc','ddd',1
2aaa,bbb,'ccc','d,d',0
to
1aaa,bbb,'cc<comma>cc','ddd',1
2aaa,bbb,'ccc','d<comma>d',0
Can someone help? Thanks. (2 Replies)
Discussion started by: bgirl
2 Replies
5. Shell Programming and Scripting
Hi,
I'm sorry if this has already been posted somewhere but I can't seem to find it on the forums (or anywhere on google :( )
I am writing a script where a user must enter a single character to perform an action.
For example, Press Q to Quit or R to Refresh
Basically I am stuggling... (5 Replies)
Discussion started by: Ste_Moore01
5 Replies
6. Shell Programming and Scripting
This reads single keystrokes and produces an output:
#! /bin/bash
while : ; do
read -s -n 1 >/dev/null 2>&1
echo ${REPLY}
done | awk '{print}'
This second one don't. Even though these examples make no sense; the real code is more complicated. Who knows what the problem is... (2 Replies)
Discussion started by: elbrand
2 Replies
7. Shell Programming and Scripting
Hi Guys,
Happy New Year to you all!
I have a requirement to read an embedded new-line using KSH's read builtin.
Here is what I am trying to do:
run_sql "select guestid, address, email from guest" | while read id addr email
do
## Biz logic goes here
done
I can take care of any... (6 Replies)
Discussion started by: a_programmer
6 Replies
8. Shell Programming and Scripting
How to remove characters enclosed in single quotes?
My data is something like this
(03/22/2011 08:17:26.650) : ( -> '1' -> '1-1-3' -> '6' -> '1' -> 'SALMOR58BB4' aaaaa bbbbbb ccccc ((dddd))
I want the output to be
(03/22/2011 08:17:26.650) : ( -> -> -> -> -> aaaaa... (2 Replies)
Discussion started by: rdhanek
2 Replies
9. Shell Programming and Scripting
Hi,
I have file in which fields are pipe (|) separated and the record separator is new line (\n). But sometime I am getting a field value which is spread across multiple line. Basically I am getting a file from another system in the below format and needs to process the file and load data into a... (3 Replies)
Discussion started by: satyaatcgi
3 Replies
10. Shell Programming and Scripting
Hi all.
I’ve 2 inputs here and would like to produce it in single ouput. I’ve drafted simple shell script but not sure how to put all this together. The final output should be “GROUP-XYZ” instead of “TEST”
Please advise.
INPUT1
GROUP-XYZ
INPUT2
type8code0@box:~/dbedit$ cat... (8 Replies)
Discussion started by: type8code0
8 Replies
LEARN ABOUT SUNOS
ddi_intr_get_navail
ddi_intr_get_nintrs(9F) ddi_intr_get_nintrs(9F)
NAME
ddi_intr_get_nintrs, ddi_intr_get_navail - return number of interrupts supported or available for a given interrupt type
SYNOPSIS
#include <sys/types.h>
#include <sys/conf.h>
#include <sys/ddi.h>
#include <sys/sunddi.h>
int ddi_intr_get_nintrs(dev_info_t *dip, int type, int *nintrsp);
int ddi_intr_get_navail(dev_info_t *dip, int type, int *navailp);
INTERFACE LEVEL
Solaris DDI specific (Solaris DDI).
ddi_intr_get_nintrs()
dip Pointer to dev_info structure
type Interrupt type
nintrsp Pointer to number of interrupts of the given type that are supported by the system
ddi_intr_get_navail()
dip Pointer to dev_info structure
type Interrupt type
navailp Pointer to number of interrupts of the given type that are currently available from the system
The ddi_intr_get_nintrs() function returns the number of interrupts of the given type supported by a particular hardware device. On a suc-
cessful return, the number of supported interrupts is returned as an integer pointed to by the nintrsp argument.
If the hardware device is not found to support any interrupts of the given type, the DDI_INTR_NOTFOUND failure is returned rather than a
zero in nintrsp.
The ddi_intr_get_navail() function returns the number of interrupts of a given type that is available to a particular hardware device. On a
successful return, the number of available interrupts is returned as an integer pointed to by navailp.
The hardware device may support more than one interrupt and can request that all interrupts be allocated. The host software can then use
policy-based decisions to determine how many interrupts are made available to the device. Based on the determination, a value is returned
that should be used to allocate interrupts with the ddi_int_alloc() function.
If the device participates in resource management, a call to ddi_intr_get_navail() tells the device driver the number of interrupts of the
given type that should be used. The host software can then use a policy-based decision to determine the number of interrupts to be allowed
to the device. If the number is more than the number of interrupts currently being used, the device driver can ask for more resources. If
the number is less than the number of interrupts currently being used, the device driver should prepare to disable and free the extra
interrupts. The number of interrupts currently available is always a snapshot in time and can change if the interface is called again.
See ddi_intr_get_supported_types(9F) for a list of valid supported types for a given hardware device. The ddi_intr_get_supported_types()
function must be called prior to calling either ddi_intr_get_nintrs() or ddi_intr_get_navail().
The ddi_intr_get_nintrs() and ddi_intr_get_navail() functions return:
DDI_SUCCESS On success.
DDI_EINVAL On encountering invalid input parameters.
DDI_INTR_NOTFOUND On not finding any interrupts for the given interrupt type.
DDI_FAILURE On any implementation specific failure.
CONTEXT
The ddi_intr_get_nintrs() and ddi_intr_get_navail() functions can be called from either user or kernel non-interrupt context.
See attributes(5) for descriptions of the following attributes:
+-----------------------------+-----------------------------+
| ATTRIBUTE TYPE | ATTRIBUTE VALUE |
+-----------------------------+-----------------------------+
|Interface Stability |Evolving |
+-----------------------------+-----------------------------+
attributes(5), ddi_intr_alloc(9F), ddi_intr_enable(9F), ddi_intr_get_supported_types(9F)
The ddi_intr_get_nintrs() and ddi_intr_get_navail() functions can be called at any time, even if the driver has added an interrupt handler
for a given interrupt specification.
Consumers of these interfaces should verify that the return value is not equal to DDI_SUCCESS. Incomplete checking for failure codes could
result in inconsistent behavior among platforms.
07 Apr 2005 ddi_intr_get_nintrs(9F)