LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
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 11-18-2008, 07:02 AM   #1
ahk_bly
LQ Newbie
 
Registered: Nov 2008
Posts: 1

Rep: Reputation: 0
Question ssh+script process in bakground


Dear all,

I am porting some test codes from Fedora core 2 to Fedora core 8.it works fine in FC2(2.6.5-1.358) but problem in FC8(2.6.23.1-42.fc8).

Pgm.c
---------
#include<stdio.h>
int main void(int)
{
fprintf(stderr,"hello world\n",);
}

$ gcc -o Pgm Pgm.c

$ vim myscript.sh
./Pgm &

$ /usr/bin/ssh -x -n -o BatchMode=yes 127.0.0.1 cd /home/tom/Test_Dir/ '&&' ./myscript.sh

If i run this command hello world is not printed.
If i run this same in FC2 hello world in printed.

Whether there is solution to this or it is a bug of FC8?

--------------------------------------------------------------------------------------------------
Below solutions are correct?.
--------------------------------------------------------------------------------------------

Solution 1:
----------
If i do these changes i.e if i re-direct to stdout and run in background.

$ vim myscript.sh
./Pgm 2>&1 &

$ /usr/bin/ssh -x -n -o BatchMode=yes 127.0.0.1 cd /home/tom/Test_Dir/ '&&' ./myscript.sh

If i run this command it works fine.

Solution 2:
----------
vim myscript.sh
./Pgm </dev/null >&/dev/null &

$ /usr/bin/ssh -x -n -o BatchMode=yes 127.0.0.1 cd /home/tom/Test_Dir/ '&&' ./myscript.sh


Regards,
Hari Krishna

Last edited by ahk_bly; 11-18-2008 at 11:06 PM.
 
  


Reply

Tags
fedora


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
redirect stderr to file with a prefix? JPMallory Programming 2 12-26-2007 03:10 PM
bash stderr redirect question code-breaker Linux - Software 1 08-06-2006 04:44 AM
how do i redirect stderr to a file? nodger Programming 5 11-28-2004 11:22 AM
Any one know how to redirect standard error (stderr) to a JetDirect printer? RickMean Linux - General 2 09-03-2004 11:33 AM
TCSH: redirect stdout and stderr seperately ugenn Linux - General 2 06-06-2002 12:07 PM


All times are GMT -5. The time now is 11:55 PM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration