![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts here. |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Background execution of a script | Cameron | Shell Programming and Scripting | 2 | 10-03-2007 02:50 AM |
| Script Exection in Background | Krrishv | Shell Programming and Scripting | 4 | 01-07-2007 08:59 AM |
| how to run script at background | happyv | Shell Programming and Scripting | 4 | 09-22-2006 04:39 AM |
| Background shell script | Moofasa | Shell Programming and Scripting | 5 | 05-12-2005 06:23 PM |
| submit a ksh script in background | captainzeb | Shell Programming and Scripting | 4 | 11-08-2003 07:49 AM |
|
|
Submit Tools | LinkBack | Thread Tools | Display Modes |
|
|||
|
Is there away to run script in background within the script
Hello all
i have csh script called test.csh , and i need to run it in the background so i do : test.csh & but i wander can i tell within the script source to run it in the background automatically , without giving the user to add the "&" when executing in the shell ? |
| Forum Sponsor | ||
|
|
|
|||
|
I'm not sure about the script running itself in the background, I doubt you can do that. You could have your script run all it's commands in the background but that isn't the same as what you're asking.
The simple solution I'd do is just write a one-liner script that calls the real script in the background, then have your user run that. For your real script test.csh, have a script called starttest.sh that goes #! /bin/sh /path/to/test.csh & And you're done. By the way, not to start a religous war or anything but you are aware csh is very rarely used for scripting because of many flaws with it, right? I'd suggest scripting in sh since it is most portable, or if you need it ksh or bash. Csh is fine for interactive use as your shell if you like it best, but it isn't good for scripting. |
|||
| Google The UNIX and Linux Forums |