Sponsored Content
Top Forums Programming want to run a function in background Post 96545 by linuxpenguin on Friday 20th of January 2006 07:32:50 PM
Old 01-20-2006
ok bankpro, fork is just a diversion from the main program. now you dont want it to return to main, then you do one thing, put the function part as a different program. and instead of calling the function, call "exec" function with the program name containing your function as the argument.
and since you want to make it run in background, you have to make the new program called in child using fork, as a daemon program.
I am sure you will find code snippets for a daemon program on the forum, if you do a search, if not check out this link
http://www.geocities.com/hemantborole/
click on KnowledgeBank, on the next page, click on C under My Programs, and in the list of programs, click on daemon.c to see the sample of the daemon process.
 

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

run a shell in the background

How can I run a shell in the background? cat test.sh #!/bin/sh sleep 600 Thank u very much indeed! (2 Replies)
Discussion started by: GCTEII
2 Replies

3. Shell Programming and Scripting

how to run script at background

Hi all, I have a script like: echo Please input list file name: read listn for file in `cat $listn.txt` do send_file $file done normally, I will run the script like: :. resendfile Please input list filename: list1 #Then, the script will resend all file from the list1. However,... (4 Replies)
Discussion started by: happyv
4 Replies

4. UNIX for Dummies Questions & Answers

can we run ssh2 in background

Hi, I was trying to run ssh2 command in background... but i got follwoing error message saying that process has been stopped.. + Stopped(SIGTTOU) Anyone have any idea about this??? Appreciated your help.. (3 Replies)
Discussion started by: pvamsikr
3 Replies

5. Shell Programming and Scripting

A question about the PID of a background function

Dear all, I'm writing a KornShell script that calls inside it a function in background mode #!/bin/ksh function myfunction { . . .} myfunction |& . . . How can I capture the PID of the function myfunction that runs in background? Thanks in advance :) (2 Replies)
Discussion started by: dariyoosh
2 Replies

6. Shell Programming and Scripting

background scripts run-help

Looking for a logic where say i have a script called parent_script which is used to call other 4 to 5 child scripts in background as.. cat parent_script # containing 65 lines 1 2 .. 35 while read child_script 36 do 37 ./child_script_name& 38 done< ${SCRIPT_LISTS} 39 40 # Need to have... (2 Replies)
Discussion started by: michaelrozar17
2 Replies

7. Shell Programming and Scripting

Run wineconsole in background

Hello everybody, I'm making a script for running a .bat process on wineconsole, but I want that wineconsole doesn't show up when I call it from the script. The script is named "reset" and it looks like this: When I execute it, it will show up the wineconsole window on top, and that is... (3 Replies)
Discussion started by: taurokpo
3 Replies

8. Shell Programming and Scripting

how to run in background mode.

Hi All, i'm a newbie here, i'm just wondering in how do i run my script in background then echo it if it's done. Please advise, Thanks, -nik (1 Reply)
Discussion started by: nikki1200
1 Replies

9. Shell Programming and Scripting

How to run Background process one after another

Hii Friends, I am using Perl CGI. I am running A SCP Command via Perl CGI in Background. Like system("scp -r machinename:/PathOfFile/ /Path/WhereToCopyIt/ &) This Copy Process takes some times lets say 15 min. Now I want When This copy process gets complete then send me... (5 Replies)
Discussion started by: Navrattan Bansa
5 Replies

10. 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
gnome-background-properties(1)					   User Commands				    gnome-background-properties(1)

NAME
gnome-background-properties - customize your desktop background SYNOPSIS
gnome-background-properties [gnome-std-options] DESCRIPTION
The Background preferences tool allows you to customize the desktop background. The desktop background is the part of the desktop where there are no interface graphical items, such as panels and windows. The desktop background is always beneath the other interface items. You can customize the desktop background in the following ways: o Select an image to display on the desktop background. The image is superimposed on the desktop background color. The desktop back- ground color is visible if you select a transparent image or if the image does not cover the entire desktop background. o Select a color for the desktop background. You can select a solid color, or create a gradient effect with two colors. A gradient effect is a visual effect where one color blends gradually into another color. OPTIONS
The following options are supported: gnome-std-optionStandard options available for use with most GNOME applications. See gnome-std-options(5). EXAMPLES
Example 1: Launching the background preference tool example% gnome-background-properties EXIT STATUS
The following exit values are returned: 0 Application exited successfully >0 Application exited with failure FILES
The following files are used by this application: /usr/bin/gnome-backgrounExecutableefor Background preferences tool ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+------------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+------------------------------+ |Availability |SUNWgnome-desktop-preferences | +-----------------------------+------------------------------+ |Interface stability |External | +-----------------------------+------------------------------+ SEE ALSO
Preference Tools Manual Latest version of the GNOME Desktop User Guide for your platform. gnome-control-center(1), gnome-std-options(5) NOTES
Written by Glynn Foster, Sun Microsystems Inc., 2003. SunOS 5.10 2 Oct 2003 gnome-background-properties(1)
All times are GMT -4. The time now is 03:54 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy