I'm just starting out with UNIX and have figured some stuff out. I just need some help with accepting user input on the command line. For instance, I created a number counter that counts down from any positive hard coded number. But, I want the commnad line line to read "Countdown 20" where 20... (1 Reply)
I'm using Red Hat Linux 3, and the computer has stopped taking input from mouse, keyboard, etc. What are possible causes? How can I fix?
-Worried Linux User (11 Replies)
He guys.
Basically I want to make a script that can add, delete and view stuff in a external file called config.txt. I can open it up in Joe but im not sure how to read in the user input or using commands automatically in joe to edit, save then quit.
Problem area below:
1) echo "Add... (1 Reply)
i need to accept the user input in my c shell script before executing next command. i have the following code which ask for user input, but does not store this value.
set req
echo " Enter your input(Y/N)?"
read req
if (req = Y)
echo " print $req"
else
echo " print $req"
... (3 Replies)
hi
I am trying to invoke another application script from my script like
---------------------------
main
.
.
./new appl <<EOF
Input 1
Input 2
EOF
.
.
exit
------------------------
But is exits the new application after input command 2, I want that it should not exit and accept... (1 Reply)
I how do i accept a input date in script which is lesser than a specified day? ex: to accept a date less than or equal to 100 days(from today).?:(
Thanks for the help in advance.:) (1 Reply)
Is there a way to display the default answer when accepting input from the user in the unix script..
e.g.
ans="n"
read $ans?"Enter y to continue n to exit:"
altough ans contains n the message doesn't display the current contents on ans .. you get
Enter y to continue n to exit: (8 Replies)
basically im trying to promt the user to create a name for a file then send the file name to a file with the list of the file names he has created. Also i want to code if the user doesnt enter any text to just print "Default Folder"
so far my code looks like:
if
then
echo "create `$1`... (1 Reply)
Hi I am trying to get my script to accept input regardless if the person enters a or A. here is the portion of the code where I get the input.
echo -n 'Please enter your choice:' # prompt user for input.
read reply # read input
echo
case $reply in #... (2 Replies)
I have this tcsh code that I want to convert to a bash script. Basically it accepts command line arguments supplied by the user and stores them, so they can be used to run a C++ program.
set arg_browseDir_inFileLst = ""
set allArgsUpCase = `echo "$*" | tr '' ''`
set opt_browseDir_flag =... (17 Replies)
Discussion started by: kristinu
17 Replies
LEARN ABOUT SUNOS
ddi_intr_add_handler
ddi_intr_add_handler(9F)ddi_intr_add_handler(9F)NAME
ddi_intr_add_handler, ddi_intr_remove_handler - add or remove interrupt handler
SYNOPSIS
#include <sys/types.h>
#include <sys/conf.h>
#include <sys/ddi.h>
#include <sys/sunddi.h>
int ddi_intr_add_handler(ddi_intr_handle_t *h, ddi_intr_handler_t inthandler, void *arg1, void *arg2);
int ddi_intr_remove_handler(ddi_intr_handle_t h);
INTERFACE LEVEL
Solaris DDI specific (Solaris DDI).
ddi_intr_add_handler()
h Pointer to the DDI interrupt handle
inthandler Pointer to interrupt handler
arg1 First argument for the interrupt handler
arg2 Second, optional, argument for the interrupt handler
ddi_intr_remove_handler()
h DDI interrupt handle
The ddi_intr_add_handler() function adds an interrupt handler given by the inthandler argument to the system with the handler arguments
arg1 and arg2 for the previously allocated interrupt handle specified by the h pointer. The arguments arg1 and arg2 are passed as the first
and second arguments, respectively, to the interrupt handler inthandler. See <sys/ddi_intr.h> for the definition of the interrupt handler.
The routine inthandler with the arguments arg1 and arg2 is called upon receipt of the appropriate interrupt. The interrupt handler should
return DDI_INTR_CLAIMED if the interrupt is claimed and DDI_INTR_UNCLAIMED otherwise.
The ddi_intr_add_handler() function must be called after ddi_intr_alloc(), but before ddi_intr_enable() is called. The interrupt must be
enabled through ddi_intr_enable() or ddi_intr_block_enable() before it can be used.
The ddi_intr_remove_handler() function removes the handler association, added previously with ddi_intr_add_handler(), for the interrupt
identified by the interrupt handle h argument. Unloadable drivers should call this routine during their detach(9E) routine to remove the
interrupt handler from the system.
The ddi_intr_remove_handler() function is used to disassociate the handler after the interrupt is disabled to remove dup-ed interrupt han-
dles. See ddi_intr_dup_handler(9F) for dup-ed interrupt handles. If a handler is duplicated with the ddi_intr_dup_handler() function, all
added and duplicated instances of the handler must be removed with ddi_intr_remove_handler() in order for the handler to be completely
removed.
The ddi_intr_add_handler() and ddi_intr_remove_handler() functions return:
DDI_SUCCESS On success.
DDI_EINVAL On encountering invalid input parameters.
DDI_FAILURE On any implementation specific failure.
CONTEXT
The ddi_intr_add_handler() and ddi_intr_remove_handler() functions can be called from kernel non-interrupt context.
See attributes(5) for descriptions of the following attributes:
+-----------------------------+-----------------------------+
| ATTRIBUTE TYPE | ATTRIBUTE VALUE |
+-----------------------------+-----------------------------+
|Interface Stability |Evolving |
+-----------------------------+-----------------------------+
attributes(5), attach(9E), detach(9E), ddi_intr_alloc(9F), ddi_intr_block_enable(9F), ddi_intr_disable(9F), ddi_intr_dup_handler(9F),
ddi_intr_enable(9F), ddi_intr_free(9F), ddi_intr_get_supported_types(9F), mutex(9F), mutex_init(9F), rw_init(9F), rwlock(9F)
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.
If a device driver that uses MSI and MSI-X interrupts resets the device, the device might reset its configuration space modifications. Such
a reset could cause a device driver to lose any MSI and MSI-X interrupt usage settings that have been applied.
The second argument, arg2, is optional. Device drivers are free to use the two arguments however they see fit. There is no officially rec-
ommended model or restrictions. For example, an interrupt handler may wish to use the first argument as the pointer to its softstate and
the second argument as the value of the MSI vector.
22 Apr 2005 ddi_intr_add_handler(9F)