LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 01-05-2013, 03:22 PM   #16
sneakyimp
Senior Member
 
Registered: Dec 2004
Posts: 1,019

Original Poster
Rep: Reputation: 67

Sadly, I am hoping to set this run up as a cron job -- I want the cron script to proceed to the following command without waiting for this to finish.
 
Old 01-06-2013, 03:50 PM   #17
Celyr
Member
 
Registered: Mar 2012
Location: Italy
Distribution: Slackware+Debian
Posts: 321

Rep: Reputation: 80
then you can sh "command" &
or use a better distribution :P
 
Old 01-06-2013, 04:14 PM   #18
jpollard
Senior Member
 
Registered: Dec 2012
Location: Washington DC area
Distribution: Fedora, CentOS, Slackware
Posts: 4,688

Rep: Reputation: 1259Reputation: 1259Reputation: 1259Reputation: 1259Reputation: 1259Reputation: 1259Reputation: 1259Reputation: 1259Reputation: 1259
It appears that the script requires a terminal input at some point. That causes it to stop until it is put in the foreground again, and some reply given.

If you have no reply (such as a default "y" or just a return) you may be out of luck. If you do have something to input, put it in a file and redirect stdin from that file:

Code:
$ php -f file.php 2>&1 > file.txt <your-input-file &
 
Old 01-07-2013, 08:35 PM   #19
sneakyimp
Senior Member
 
Registered: Dec 2004
Posts: 1,019

Original Poster
Rep: Reputation: 67
Quote:
Originally Posted by jpollard View Post
It appears that the script requires a terminal input at some point. That causes it to stop until it is put in the foreground again, and some reply given.

If you have no reply (such as a default "y" or just a return) you may be out of luck. If you do have something to input, put it in a file and redirect stdin from that file:

Code:
$ php -f file.php 2>&1 > file.txt <your-input-file &
You may have a point here. If you look at the trivial scripts I posted previously, you can see that I am in no way reading STDIN or prompting a user for input -- not even checking $_GET or $_POST or argv/argc or anything like that. Still, I'm wondering if there is something about the command I'm using that causes this to happen?

So confused.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Weird thing in redirecting stdout and stderr brubizu Linux - Software 2 07-01-2010 11:09 AM
redirecting BASH script stdout/stderr from the script itself Hewson Linux - General 4 04-18-2008 03:32 PM
Redirecting stdout, stderr to pty0? Rostfrei Linux - General 4 03-20-2007 03:15 AM
redirecting stdout to /dev/null and stderr to stdout? Thinking Programming 1 05-18-2006 02:36 AM
redirecting stdout and stderr to a file Avatar33 Programming 4 03-12-2005 07:55 AM


All times are GMT -5. The time now is 01:22 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration