Sponsored Content
Top Forums Shell Programming and Scripting Listing all local variables for unset Post 302865427 by powwm on Friday 18th of October 2013 12:00:55 PM
Old 10-18-2013
thanks

I had previously been using an until loop to cycle the program back around and that required the unset. I made the wrong assumption exec would require the same. Thanks for the information.
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

rsh with local variables

Hi, I am trying to do an rsh and execute the same script on a distant unix computer. The problem is that I need to get all the local variables of the distant computer to launch correctly my script. I'm working on AIX 4.3.3 I try to execute .profile in the rsh but it seems not to be... (1 Reply)
Discussion started by: jo_aze
1 Replies

2. Shell Programming and Scripting

Problem with global and local variables

Guys, how can I define global variables in sorlaris...cause I lose the values outside the scope. Rite now wat I do is,I redirect variable value to a file n then get it back outside the function...:o....theres obviously a better way of doing this...I now this is a basic question....but please... (2 Replies)
Discussion started by: qzv2jm
2 Replies

3. Shell Programming and Scripting

Listing a directory via a script using variables

In my script I need to list the directory, where the generic name of the files will change, in my test case its set to TEST_*.mqsc. I wrote a small test script as below, but it just does not pip the listing to a file. Any idea why? dir='C:/cygwin/var/log/img/aut/' file=TEST01_*.mqsc ls $dir... (4 Replies)
Discussion started by: gugs
4 Replies

4. Shell Programming and Scripting

'while' loop does not change local variables?!

(I think this question desearves separate thread..) I have a problem with 'while' I am trying to set variables by 'while' and it is fine inside, but after completting the loop all changes are lost: > bb="kkkk - 111\nlllll - 22222\nbbbb - 4444" > echo "$bb" kkkk - 111 lllll - 22222 bbbb -... (3 Replies)
Discussion started by: alex_5161
3 Replies

5. Shell Programming and Scripting

How to unset all variables in shell?

can I use unset to unset all the variables in a shell sciprt? VAR1=1 VAR2=2 VAR3=3 unset whether this unset will afftect any system variables? Thanks, (3 Replies)
Discussion started by: balamv
3 Replies

6. Shell Programming and Scripting

How to check exit status of unset variables

Hi All, Is there any way to check exit status of unset variables? In the following code PathX is not set and the script terminates without checking exit status. #!/bin/bash Path="/tmp/log" cd ${PathX:?} if ;then echo "Exit Status : non zero" else echo "Exit Status :... (2 Replies)
Discussion started by: sussus2326
2 Replies

7. Programming

Thread function local variables

As I know threads share the memory. But, what about the local variables in the thread function? if i call multiple threads would they allocate seperate local variables for themselves? like thread_func() { int i, j; string... } Are the above local variables defined for each of... (1 Reply)
Discussion started by: saman_glorious
1 Replies

8. Shell Programming and Scripting

[ask] about unset variables

I'm wondering, is the number of variables will affect execution time of my bash script or maybe affect the cpu workload, cpu memory, etc ? If I create so many variables, should I unset each one of that variables after I used them or after I think they are no longer needed? and if my script... (2 Replies)
Discussion started by: 14th
2 Replies

9. UNIX for Dummies Questions & Answers

File listing from remote to local directory

Hello, I have a file at remote server. I have to select only current day's files that are dropped on ftp server. The files do not have date or timestamp on them. so I plan to get the file listing from remote server to the local server. Based on file listing date I can find out when the files... (2 Replies)
Discussion started by: pavan_test
2 Replies

10. Shell Programming and Scripting

Unset variables in shell when it running two different loops

I have a script to start/stop/restart the tomcat application. When we run the script first time i.e stop/start it set all env variables(DISTRIB_ID,NAME,TOMCAT_CFG,....etc),but when we restart the tomcat it is running in the same shell.....I need to set the variables when i restart the tomcat(in the... (1 Reply)
Discussion started by: praveen265
1 Replies
XHPSSChangeNotify(3X)													     XHPSSChangeNotify(3X)

NAME
XHPSSChangeNotify - Allows applications to receive notification of screen saver state changes. SYNOPSIS
#include <X11/XHPlib.h> int XHPSSChangeNotify (display, ssHandle, flags) Display *display; Atom *ssHandle; int flags; ARGUMENTS
display Specifies the connection to the X server. ssHandle Specifies a pointer to an atom, into which the X server will return a unique identifying screen saver id. flags Specifies the bit mask that indicates the type of notifications the application wants to receive. The first bit (bit 0) determines screen saver 'on' and 'off' states. The second bit (bit 1) indicates the 'draw' and 'cycle' notification. DESCRIPTION
These requests are part of an HP-proprietary extension to X. These requests allow one or more X clients to react to screen saver state changes, such as locking the screen when the screen blanks or drawing patterns on the screen. To receive 'on' and 'off' messages, the application only needs to call XHPSSChangeNotify(). To also receive 'draw' and 'cycle' messages, the application needs to call XSetScreenSaver() as well as XHPSSChangeNotify(). To enable the screen saver, applications must first call XSetScreenSaver() and set the prefer_blanking to DontPreferBlanking. The X server will not generate 'draw' and 'cycle' notification when blanking is turned on. The allow_exposures flag must be set to AllowExposures. This ensures that proper notification will be sent out when it is safe to do drawing. This can also be done with "xset s noblank s expose". To begin receiving information on screen saver state changes, applications must use the XHPSSChangeNotify() function. Depending on how the flags have been set, the screen saver program can receive notification of the following event_types: XHP_SCREEN_SAVER_ON: The screen saver timeout has initially expired. This is typically visually indicated by the screen blanking. XHP_SCREEN_SAVER_OFF: The screen saver has been reset, due to user input or mouse movement. XHP_SCREEN_SAVER_DRAW: The screen saver program can now draw into the screen saver window; the window id is supplied as part of the notification. XHP_SCREEN_SAVER_CYCLE: The cycle timeout has expired; this allows a screen saver program to modify (or animate) what it is displaying in the screen saver window. Caveat: Even if you enable bit 1, thus requesting 'draw' and 'cycle' notification, you will only receive these *if* you had disabled blanking, using the calls described earlier! Once you have registered interest in screen saver notification, you will receive X events whose 'type' is set to 'ClientMessage', and whose message type is the atom passed back by XHPSSChangeNotify(). For instance, the following event loop would detect and dispatch screen saver events: XEvent event; for (;;) { XNextEvent (display &event); if ((event.type == ClientMessage) && (event.xclient.message_type == ssHandle)) { /* add code to dispatch screen saver event */ } } In the case of the XHP_SCREEN_SAVER_DRAW notification, you will also receive the window id for the screen saver window. This window id is specified within the event.xclient.data.l[1] field and the event type is specified within event.xclient.data.l[0] field: XClientMesssageEvent * message = (XClientMessageEvent *) &event; event_type = message->data.l[0]; window = message->data.l[1]; EXAMPLES
This is a sequence of notification event_types a screen saver application might see: Bit 1 off, or blanking enabled: ------------------------------- XHP_SCREEN_SAVER_ON (When screen saver timeout expires) XHP_SCREEN_SAVER_OFF (When input occurs or mouse is moved) Bit 1 on, and blanking disabled: -------------------------------- XHP_SCREEN_SAVER_ON (When screen saver timeout expires) XHP_SCREEN_SAVER_DRAW (When it is safe to draw in the specified window id) XHP_SCREEN_SAVER_CYCLE (When screen saver cycle timeout expires) . . . XHP_SCREEN_SAVER_CYCLE (When screen saver cycle timeout expires) XHP_SCREEN_SAVER_OFF (When input occurs or mouse is moved) In the case that there are more than one screen attached to the X server, applications will receive screen saver events for each screen, even screens that are not visible. Care should be taken to avoid rendering to a window using the wrong screen. To determine the screen, use the following: XGetWindowAttributes(display, event, window, &attr); screenNum = XScreenNumberOfScreen(attr.screen); CAUTION: An X error handler should be registered to catch attempts to draw to a non-existent window. The screen saver window is a special window that is created and destroyed by the X Server. It is possible, in the case that a short timeout is defined, that the client may issue draw requests to a window that has been destroyed before it completes all of its requests. If an error handler is not supplied, the application will most likely terminate. RETURN VALUE
This function returns 0 upon successful completion, -1 when the X Server is too old to support Screen Saver calls and 1 when too many screen saver clients have already registered. There can be a maximum of 10 registered screen saver clients. FILES
none ORIGIN
Hewlett-Packard Company SEE ALSO
XSetScreenSaver(3x) xset(1) X Version 11 Release 5 XHPSSChangeNotify(3X)
All times are GMT -4. The time now is 02:09 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy