Sponsored Content
Top Forums Shell Programming and Scripting A question about the PID of a background function Post 302298058 by dariyoosh on Monday 16th of March 2009 02:34:26 PM
Old 03-16-2009
Quote:
Originally Posted by vgersh99
Code:
#!/bin/ksh

myfunction |&

echo $!


Thanks a lot, it works pretty well now

Regards,
Smilie
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

subshell & background function

Hello all, Can someone explain to me the advantage between using subshell over a function call in scripts? To me these are the same. Am I wrong to think this? (4 Replies)
Discussion started by: larry
4 Replies

2. Shell Programming and Scripting

PID of process started in background??

I am having a problem getting the PID of a process I start in the background is a csh. In tcsh and sh it's simple $! give it to you But in csh this just returns Variable syntax From the man page it should work but it doesn't???? Any help. (2 Replies)
Discussion started by: stilllooking
2 Replies

3. Programming

want to run a function in background

consider the given prg. main() { ..... function1(); /* to write into a file or log */ printf(" "); ..... } when the control reaches function1(), it should get executed in the background.At the same time main's printf(" ") statement should also get executed.i.e... (5 Replies)
Discussion started by: bankpro
5 Replies

4. Shell Programming and Scripting

How to find pid of PS which executed by perl system function

hello All, I need to invoke by perl script some program/command and monitor it for 5 minutes . In case it still running for more then 5 min I need to send a signal which will stop it. I implemeted this as shown below by using eval & alarm and I'd like to know if there is a better way to... (1 Reply)
Discussion started by: Alalush
1 Replies

5. Shell Programming and Scripting

kill PID running in background in for loop

Guys, can you help me in killing the process which is running in back ground under for loop I am not able to find the PID using ps -afx|grep <word in command I entered> (1 Reply)
Discussion started by: mohan_xunil
1 Replies

6. Shell Programming and Scripting

does the pid of background process show in /proc?

Hi all, I'm reading <advanced bash scripting> and there is a example to kill a background process in a limited time,as shown below: #! /bin/bash #set -n TIMEOUT=$1 count=0 hanging_jobs & { while ((count < TIMEOUT));do eval ' && ((count = TIMEOUT))' ((count++)) sleep 1... (6 Replies)
Discussion started by: homeboy
6 Replies

7. Shell Programming and Scripting

PID from background ssh

Hello. I was wondering if someone can help me out with something. To simplify my life, I have written a tiny script to open an ssh tunnel through another linux host so that I can access the esxi hosts on that network using the client. For this I have to tunnel ports 443, 902, and 903. Here is what... (1 Reply)
Discussion started by: numetheus
1 Replies

8. Shell Programming and Scripting

Background process, return code and pid.

Hey all, Okay, this one is tricky and I'm not sure there is a niec way to do it, or indeed anyway to do it. The main issue revolves around timing out a hung ssh. I am doing this by creating a wrapper script for the ssh with the following requirements. My requirements are: Defineable... (5 Replies)
Discussion started by: RECrerar
5 Replies

9. Shell Programming and Scripting

Execute a function in background and then suspend it

Here is some back ground on the script. The script is to poll an arbitrary number of DB's. To do this I am creating a function that takes the file_path to the DB and the min poll interval as arguments. The function will be called for each DB and then ran in the background. The function I was... (6 Replies)
Discussion started by: ryandavison
6 Replies

10. Shell Programming and Scripting

[SOLVED] Using "$!" to get the PID of the Last Ran Background Process

Hello All, I was looking into creating a script that would be used only to start a Daemon and create a lock file... F.Y.I. It's for Nagios' NRPE Daemon Plugin... Anyway when I run the command to start the Daemon (below): /usr/local/nagios/bin/nrpe -c /usr/local/nagios/etc/nrpe.cfg -d And... (14 Replies)
Discussion started by: mrm5102
14 Replies
XCreateSimpleWindow()													     XCreateSimpleWindow()

Name
  XCreateSimpleWindow - create an unmapped InputOutput window.

Synopsis
  Window XCreateSimpleWindow(display, parent, x, y, width, height, border_width, border, background)
	Display *display;
	Window parent;
	int x, y;
	unsigned int width, height, border_width;
	unsigned long border;
	unsigned long background;

Arguments
  display  Specifies a pointer to the Display structure; returned from XOpenDisplay().

  parent   Specifies the parent window ID.  Must be an InputOutput window.

  x	   Specify  the  x  and y coordinates of the upper-left pixel of the new window's border relative to the origin of the parent (inside
  y	   the parent window's border).

  width    Specify the width and height, in pixels, of the new window.	These are the inside dimensions, not including the new window's  bor-
  height   ders,  which are entirely outside of the window.  Must be non-zero.	Any part of the window that extends outside its parent window
	   is clipped.

  border_width
	   Specifies the width, in pixels, of the new window's border.

  border   Specifies the pixel value for the border of the window.

  background
	   Specifies the pixel value for the background of the window.

Returns
  The window.

Description
  XCreateSimpleWindow() creates an unmapped InputOutput subwindow of the specified parent window.  Use XCreateWindow() if you want to set the
  window attributes while creating a window.  (After creation, XChangeWindowAttributes() can be used.)

  XCreateSimpleWindow()  returns  the  ID  of the created window.  The new window is placed on top of the stacking order relative to its sib-
  lings. Note that the window is unmapped when it is created - use MapWindow to display it.  This function generates a CreateNotify event.

  The initial conditions of the window are as follows:

  o  The window inherits its depth, class, and visual from its parent.	All other window attributes have their default values.

  o  All properties have undefined values.

  o  The new window will not have a cursor defined; the cursor will be that of the window's parent until the cursor  attribute	is  set  with
     XDefineCursor() or XChangeWindowAttributes().

  o  If no background or border is specified, CopyFromParent is implied.

  For more information, see Volume One, Chapter 2, X Concepts, and Volume One, Chapter 3, Basic Window Program.

Errors
  BadAlloc

  BadMatch

  BadValue  width or height is zero.

  BadWindow Specified parent is an InputOnly window.

See Also
  XCreateWindow(), XDestroySubwindows(), XDestroyWindow().

Xlib - Window Existence 												     XCreateSimpleWindow()
All times are GMT -4. The time now is 04:17 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy