LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware > Linux - Embedded & Single-board computer
User Name
Password
Linux - Embedded & Single-board computer This forum is for the discussion of Linux on both embedded devices and single-board computers (such as the Raspberry Pi, BeagleBoard and PandaBoard). Discussions involving Arduino, plug computers and other micro-controller like devices are also welcome.

Notices


Reply
  Search this Thread
Old 08-31-2016, 08:59 PM   #1
lxdev
LQ Newbie
 
Registered: Jul 2016
Posts: 15

Rep: Reputation: Disabled
Executable file unable to run in the background after appending '&'


Dear fellow coders, when I tried to run my vendor framebuffer executable file in the background i.e.
./hifb_sample &, i'm unable to start the program in the background. It shows up the following error as soon as my command line above is executed:

-sh: 0: not found
[1]+ Stopped (tty input) ./sample_hifb


FYI, I'm able to run the .exe file as per normal so the .exe file is working properly. (i.e. ./hifb_sample).
Attached Thumbnails
Click image for larger version

Name:	qt hifb & error.JPG
Views:	16
Size:	37.7 KB
ID:	22904  
 
Old 08-31-2016, 09:57 PM   #2
jpollard
Senior Member
 
Registered: Dec 2012
Location: Washington DC area
Distribution: Fedora, CentOS, Slackware
Posts: 4,912

Rep: Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513
The program requires input from the terminal - yet your use of the & for background detached from the terminal input - which allowed the command interpreter to take it. Thus your "0" went to the command interpreter which told you it couldn't find a program named "0".

If the program doesn't need terminal input you can put it in the background. If all it needs is some initial input you can redirect the input from a file.

If you have to enter something to start it, but it doesn't need anything after that, then you run it in the foreground, give it the input. Once it starts running as a cpu bound process and no longer needs the terminal you can put it in the background by first using the "control Z" key to suspend it. This gives the terminal input back to the command interpreter, where you can give the command "bg" (short for BackGround) which will put it in the background.
 
Old 09-14-2016, 09:16 PM   #3
lxdev
LQ Newbie
 
Registered: Jul 2016
Posts: 15

Original Poster
Rep: Reputation: Disabled
Thanks jpollard, manage to got the program running in the background by appending & after the run command. After which I just entered into other programs to run on top of this framebuffer.
 
  


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] How to run a program in background and also using && to execute another command P.G.Krish Linux - Newbie 6 06-09-2016 07:22 AM
Make a file executable and then run mostafaashish Linux - Newbie 7 02-20-2014 06:34 AM
Can't run an executable file dungnguyen Linux - Newbie 7 07-02-2012 01:00 PM
I want to run php file in background on fedora terminal in background. gauravwcities Linux - Newbie 8 01-18-2012 01:23 AM
Executable unable to run kakikomi Linux - Newbie 4 03-30-2010 03:38 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware > Linux - Embedded & Single-board computer

All times are GMT -5. The time now is 09:34 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
Open Source Consulting | Domain Registration