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)
Dear Friends,
I am doing a sh shell script , But I dont have any idea how to read value from user Keyboard and store them to an array .. Is it possible or not I am not also sure in sh shell script ?
EX:-
#! /bin/sh
read DATA
echo "DATA -" $DATA
echo "DATA -" $DATA
echo "DATA... (7 Replies)
Dear All,
The sqlplus 'Accept' command is not waiting for user input when I include the command within a shell script.
Note: The 'Accept' command is working fine if I execute it in a SQLPLUS Prompt.
Please fins the below sample script which i tried.
SCRIPT:
--------
#!... (4 Replies)
All,
problem Description: For example: I have two shell scripts(executables). let name it as script1 and script2.I'm trying to execute script1 from script2. while executing script2, script1 is asking for manual input(input from keyboard).
Now i need to know how I can skip this user input... (3 Replies)
I want to create an array which can store the strings from the user input in shell script .
example :-
I want to store the 5 fruits name in a single array which the user provides . (1 Reply)
i have a script which takes input from user, if user gives either Y/y then it should continue, else it should quit by displaying user cancelled.
#!/bin/sh
echo " Enter your choice to continue y/Y OR n/N to quit "
read A
if
then
echo " user requested to continue "
##some commands... (7 Replies)
How to check the user input to be valid using shell script?
The valid input is in the format like as follows.
1. It can only have r,w,x or a hyphen and nothing else.
2. ensure the r, w, x are in the correct order.
for example: rwxr-xr-x is a valid format.
Thanks (5 Replies)
I want a shell script that accepts user input simultaneously when performing other tasks. Example: A shell script should echo some messages on the console and when the user presses some keys it should respond to that action.
say, when user presses the key
A - more information should be printed... (2 Replies)
I still cannot figure out how to get this read command to work. I want the script to ask questions when prompted, and the user to enter a response. Based on response it will continue or exit. I have not worked with this type of script before so I am almost clueless on what to do, and so far google... (6 Replies)
Hello, I want to start out by saying that I am fairly new to scripting and am looking for someone that can point me in the right direction.
Basically what I need is a way to run a interactive script that will prompt users with questions weather that be yes/no or a specific answer.. I want to be... (3 Replies)
Discussion started by: shoutcast
3 Replies
LEARN ABOUT CENTOS
xcb_query_tree_reply
xcb_query_tree(3) XCB Requests xcb_query_tree(3)NAME
xcb_query_tree - query the window tree
SYNOPSIS
#include <xcb/xproto.h>
Request function
xcb_query_tree_cookie_t xcb_query_tree(xcb_connection_t *conn, xcb_window_t window);
Reply datastructure
typedef struct xcb_query_tree_reply_t {
uint8_t response_type;
uint8_t pad0;
uint16_t sequence;
uint32_t length;
xcb_window_t root;
xcb_window_t parent;
uint16_t children_len;
uint8_t pad1[14];
} xcb_query_tree_reply_t;
Reply function
xcb_query_tree_reply_t *xcb_query_tree_reply(xcb_connection_t *conn, xcb_query_tree_cookie_t cookie, xcb_generic_error_t **e);
Reply accessors
xcb_window_t *xcb_query_tree_children(const xcb_query_tree_request_t *reply);
int xcb_query_tree_children_length(const xcb_query_tree_reply_t *reply);
xcb_generic_iterator_t xcb_query_tree_children_end(const xcb_query_tree_reply_t *reply);
REQUEST ARGUMENTS
conn The XCB connection to X11.
window The window to query.
REPLY FIELDS
response_type
The type of this reply, in this case XCB_QUERY_TREE. This field is also present in the xcb_generic_reply_t and can be used to
tell replies apart from each other.
sequence The sequence number of the last request processed by the X11 server.
length The length of the reply, in words (a word is 4 bytes).
root The root window of window.
parent The parent window of window.
children_len
The number of child windows.
DESCRIPTION
Gets the root window ID, parent window ID and list of children windows for the specified window. The children are listed in bottom-to-top
stacking order.
RETURN VALUE
Returns an xcb_query_tree_cookie_t. Errors have to be handled when calling the reply function xcb_query_tree_reply.
If you want to handle errors in the event loop instead, use xcb_query_tree_unchecked. See xcb-requests(3) for details.
ERRORS
This request does never generate any errors.
EXAMPLE
/*
* Displays the root, parent and children of the specified window.
*
*/
void my_example(xcb_connection *conn, xcb_window_t window) {
xcb_query_tree_cookie_t cookie;
xcb_query_tree_reply_t *reply;
cookie = xcb_query_tree(conn, window);
if ((reply = xcb_query_tree_reply(conn, cookie, NULL))) {
printf("root = 0x%08x
", reply->root);
printf("parent = 0x%08x
", reply->parent);
xcb_window_t *children = xcb_query_tree_children(reply);
for (int i = 0; i < xcb_query_tree_children_length(reply); i++)
printf("child window = 0x%08x
", children[i]);
free(reply);
}
}
SEE ALSO xcb-requests(3), xcb-examples(3), xwininfo(1)AUTHOR
Generated from xproto.xml. Contact xcb@lists.freedesktop.org for corrections and improvements.
XCB 2014-06-10 xcb_query_tree(3)