Sponsored Content
Full Discussion: Help with getopts command
Top Forums Shell Programming and Scripting Help with getopts command Post 302471409 by purdym on Friday 12th of November 2010 05:05:22 PM
Old 11-12-2010
As a follow up, if someone knows how to make long options in KSH, I'd be interested in knowing how.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

getopts help

Hi i have part of the scripts below ,getopt for -h or ? not working for me. can anybody tell me if this sytax right or wrong. #!/usr/bin/ksh program=$(basename $0) ##################################################################################### function usageerr { RC=1 ... (3 Replies)
Discussion started by: GrepMe
3 Replies

2. Shell Programming and Scripting

Help in getopts

Hi, My script will take a input file as a parameter(which is not mandatory) and also an option. ksh my_script.sh <inputfile> The option -n I have given is no way related to the input file. Now the problem here is when i execute the script specifying the input file and the option(the way... (4 Replies)
Discussion started by: chella
4 Replies

3. Shell Programming and Scripting

File handling, getopts command in unix

I need to create a shell script having the menu with few options such as 1. Listing 2. Change permissions 3. Modify Contents 4. Delete Files 5. Exit 1. For 1. Listing: Display a special listing of files showing their date of modification and access time (side by side) along with their... (2 Replies)
Discussion started by: bab123
2 Replies

4. HP-UX

using getopts

Is there a restriction on levels of using 'getopts' ? I have several scripts, each of which requires an option as the first parameter . If I call one prg separately it works fine, but when one prg calls another prg and passes the option on the called prg, then the called prg seems not to process... (3 Replies)
Discussion started by: vslewis
3 Replies

5. UNIX for Dummies Questions & Answers

getopts - command line arguments

Hi, I'm having problems with a script where I wanted every single option specified in the command line to have an argument taken with it, but for some reason only d works in the code I will be showing below. For example if I did ./thisfile -a something it would come up with "a chosen with " as... (2 Replies)
Discussion started by: IceX
2 Replies

6. Shell Programming and Scripting

using getopts to parse a command line

i have the following scenario want to run the following script with manadory and optional argumnets Manadory options are : filename="" port="" optional arguments type -t balances -b bal prices -p ./test filename port -t A -b bal my code i have that won't parse the options is... (1 Reply)
Discussion started by: nano2
1 Replies

7. Shell Programming and Scripting

bash:getopts command help

How can I say one of the options is required? can I use an if statement? let say: while getopts ":c:u:fp" opt; do case $opt in c) echo "-c was triggered, Parameter: $OPTARG" >&2;; u) echo "-u was triggered, Parameter: $OPTARG" >&2;; f) echo "-u was triggered,... (2 Replies)
Discussion started by: bashily
2 Replies

8. Shell Programming and Scripting

Getopts how to handle missing '-' in command line args.

I'm using getopts to process command line args in a Bash script. The code looks like this: while getopts ":cfmvhs:t:" option; do case $option in c) operationMode="CHECK" ;; f) operationMode="FAST" ;; m) ... (6 Replies)
Discussion started by: gencon
6 Replies

9. Shell Programming and Scripting

Getopts help

Hi All, I am writing a script to pass the getopts argument to the function which I have. But it as soon as I execute the script, the argument is taking it as blank. I tried using multiple way to check but its not working. Can someone please let me know what wrong in this code. function1()... (4 Replies)
Discussion started by: sidh_arth85
4 Replies

10. Shell Programming and Scripting

How-to enforce check on getopts command

here is my script that expects the user to run it like ./best.sh -f /tmp/log.txt more best.sh #!/bin/bash while getopts ":f:" opt; do case $opt in f) file_in="$OPTARG" ;; \?) echo "Invalid option -$OPTARG" >&2 ;; esac done uname -a SunOS mymac 5.11 11.2 sun4v... (15 Replies)
Discussion started by: mohtashims
15 Replies
XSelectInput(3X11)						     MIT X11R4							XSelectInput(3X11)

Name
       XSelectInput - select input events

Syntax
       XSelectInput(display, w, event_mask)
	  Display *display;
	  Window w;
	  long event_mask;

Arguments
       display	 Specifies the connection to the X server.

       event_mask
		 Specifies the event mask.

       w	 Specifies the window whose events you are interested in.

Description
       The function requests that the X server report the events associated with the specified event mask.  Initially, X will not report any of
       these events.  Events are reported relative to a window.  If a window is not interested in a device event, it usually propagates to the
       closest ancestor that is interested, unless the do_not_propagate mask prohibits it.

       Setting the event-mask attribute of a window overrides any previous call for the same window but not for other clients.	Multiple clients
       can select for the same events on the same window with the following restrictions:

       o    Multiple clients can select events on the same window because their event masks are disjoint.  When the X server generates an event,
	    it reports it to all interested clients.

       o    Only one client at a time can select or events, which are associated with the event mask

       o    Only one client at a time can select a event, which is associated with the event mask

       o    Only one client at a time can select a event, which is associated with the event mask

       The server reports the event to all interested clients.

       can generate a error.

Diagnostics
       A value for a Window argument does not name a defined Window.

See Also
       X Window System: The Complete Reference, Second Edition, Robert W. Scheifler and James Gettys

																XSelectInput(3X11)
All times are GMT -4. The time now is 09:58 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy