05-21-2014
You nailed it Don.
(I will reply with another post after I try all these examples. Thanks guys.)
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Guys look at this:
i have to write a script that takes a file as an argument. The script should be able to determine what permissions the owner, group and everybody has for the file passed in. The output should be displayed similar to this.
READ WRITE EXECUTE
OWNER LEE.BALLANCORE YES YES NO... (9 Replies)
Discussion started by: ciroredz
9 Replies
2. UNIX for Dummies Questions & Answers
Hi there,
When I try to do a condition on test:
$ str1=abcd
$ test $str1
$ echo $?
0
Is there anyway to display the answer to be 'TRUE' or 'YES'? rather than 0?
If so, how can I do it without using awk or sed. (2 Replies)
Discussion started by: felixwhoals
2 Replies
3. Shell Programming and Scripting
Hello,
what is the better and correct way to perform a comparison:
I have been using the following with no problems:
if ]
then ....
fi
I have seen this also used :
if
then ....
fi
When I try :
if
then ....
fi
I get an error like .... the test condition expects a... (4 Replies)
Discussion started by: gio001
4 Replies
4. Shell Programming and Scripting
Hi there,
I tried to search for this almost everywhere, but didnt get any proper information on it.
What is the difference between
]
Some of the code works when I have only single condition i.e.
] && $dothis1 || $dothis2
But if i try to include another testcondition to the... (1 Reply)
Discussion started by: tostay2003
1 Replies
5. Shell Programming and Scripting
This is the code:
while test 1 -eq 1
do
read a
$a
if test $a = stop
then
break
fi
done
I read a command on every loop an execute it.
I check if the string equals the word stop to end the loop,but it say that I gave too many arguments to test.
For example echo hello.
Now the... (1 Reply)
Discussion started by: Max89
1 Replies
6. Shell Programming and Scripting
How to check weather a string is like test* or test* ot *test* in if condition (5 Replies)
Discussion started by: johnjerome
5 Replies
7. Shell Programming and Scripting
Hi there, I have a bunch of interface names like
e1000g0
nge1
dmfe3
I also have some that have longer (vlan tagged) names
like
e1000g123001
nge23003
e1000g999002
I need to determine whether the interface is one of the former or latter types and I would do that by seeing... (7 Replies)
Discussion started by: rethink
7 Replies
8. Shell Programming and Scripting
Hi there, im sure this is really simple but i have some strings like this
e1000g123001
e1000g0
nge11101
nge3and i want to create two variables ($DRIVER and $INSTANCE). the first one containing the alpha characters that make up the first part of the string, e.g. e1000g or nge and the... (9 Replies)
Discussion started by: rethink
9 Replies
9. Shell Programming and Scripting
Hi,
I am trying to remove lines once a string is found till another string is found including the start string and end string. I want to basically grab all the lines starting with color (closing bracket). PS: The line after the closing bracket for color could be anything (currently 'more').... (1 Reply)
Discussion started by: Dabheeruz
1 Replies
10. Solaris
Hi all,
I have written the following program and run on both T5440 and T5220 on same OS version. I found that T5540 server takes more time than T5220. Please find below the details.
test1.cpp
#include <iostream>
#include <pthread.h>
using namespace std;
#define NUM_OF_THREADS 20... (17 Replies)
Discussion started by: sanjay_singh85
17 Replies
LEARN ABOUT CENTOS
xcb_query_tree
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)