Register
It is currently Fri Oct 24, 2014 11:35 pm

Problem spawning process


All times are UTC - 6 hours


Post new topic Reply to topic  [ 4 posts ] 
Author Message
 PostPosted: Wed Aug 08, 2007 4:38 pm   

Joined: Mon Jun 25, 2007 8:33 am
Posts: 4
Hey guys,

I am trying the following:

Code:
MYCMD="make&"
$($MYCMD)


It says that there is no file called "make&". Is there any way to get this to work?
The above example is a simple one. My actual script gives the user the option to "fork" the process by adding a "&" and redirect the output by adding " &> /dev/null" to the end. :?:


Top
 Profile  
 PostPosted: Thu Aug 09, 2007 12:55 pm   
Moderator
User avatar

Joined: Wed May 03, 2006 2:05 pm
Posts: 242
Heya bpetty!

The only way I've been able to make that work is by putting a space between the command and the ampersand.


Top
 Profile YIM  
 PostPosted: Thu Aug 09, 2007 1:16 pm   

Joined: Mon Jun 25, 2007 8:33 am
Posts: 4
Yeah, I tried that. It finds the application, but it uses & as an argument... not as a special character for creating a new thread of execution for the app.
For now I'll rewrite it with if statements. It is not as clean, but atleast it will work.

Thanks.


Top
 Profile  
 PostPosted: Sun Oct 21, 2007 4:29 am   

Joined: Fri Oct 19, 2007 3:09 pm
Posts: 3
This works for me ..

Code:
MYCMD="make&"
eval "$MYCMD"


Top
 Profile  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC - 6 hours


Who is online

Users browsing this forum: Bing [Bot] and 4 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
cron


BashScripts | Promote Your Page Too
Powered by phpBB © 2011 phpBB Group
© 2003 - 2011 USA LINUX USERS GROUP