Sponsored Content
Top Forums Shell Programming and Scripting Data pipe lost when using ssh in shell script Post 302594775 by siavash on Wednesday 1st of February 2012 06:28:23 AM
Old 02-01-2012
Thanks itkamaraj

Also, I found another solution.
Usin "-n" with SSH will redirect output to /dev/null and SIGTTIN will not break the STDIN.
 

9 More Discussions You Might Find Interesting

1. Filesystems, Disks and Memory

Lost Data Lost Admin

First time so excuse my ignorance please. I may not be accurately describing the issue. I have inherited a small lab mostly SUN V120s. We lost power and are trying to recover. Nope no backups... The primary issue I have is 1 box is an Oracle Server. It has 2 36Gb harddrives. I am able to... (3 Replies)
Discussion started by: murphsr
3 Replies

2. Shell Programming and Scripting

Pipe data to shell script

Sorry about the noobish question but... How do I capture data thats piped to my script? For instance, ls -al | myscript.sh How do I access the output from ls -al in myscript.sh? (3 Replies)
Discussion started by: tomjones07
3 Replies

3. UNIX for Dummies Questions & Answers

New to shell script and lost....

I am really stuck on something I am sure you all will find simple. I am VERY new to shell scripting and I am trying to figure out how to do a or statement below. So if it = 11 or 31 then... if ; then Please keep in mind I do not know much on shell scripting and thank you in advance as... (8 Replies)
Discussion started by: LRoberts
8 Replies

4. Post Here to Contact Site Administrators and Moderators

My shell pipe 2 multipipes thread is lost ?

Hi, yesterday I have got reply in my thread how to redirect shell pipe to 2 pipes. I would read that answer once again, as my re.re. is also lost Jack (6 Replies)
Discussion started by: jack2
6 Replies

5. Shell Programming and Scripting

How to use ssh execute other shell script on other host (shell script include nohup)?

i want use ssh on the host01 to execute autoexec.sh on the host02 like following : host01> ssh host02 autoexec.sh autoexec.sh include nohup command like follwing : nohup /home/jack/deletedata.sh & after i execute ssh host02 autoexec.sh one the host01. i can't found deletedata.sh... (1 Reply)
Discussion started by: orablue
1 Replies

6. Shell Programming and Scripting

Using Named pipe in shell script

Hi, I want to use a Named pipe to get input from a growing file for further processing. When I prototype this scenario using a while loop, the data is not written to the named pipe. This the script I use to get data into the Named pipe: #!/bin/ksh mkfifo pipe while (( n <= 10 )) do echo... (2 Replies)
Discussion started by: sudvishw
2 Replies

7. Homework & Coursework Questions

Lost in shell script

Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted! 1. The problem statement, all variables and given/known data: Hey whats up everyone, Currently I'm stuck. In this question I have to use the following commands test, shift,... (7 Replies)
Discussion started by: AdamSahp
7 Replies

8. Shell Programming and Scripting

How to pipe command output to shell script?

Hi Team, Need a help on how to pipe a command out put to a shell script. My shell script looks like below. cat shell_script #!/usr/bin/ksh input =$@ echo " we are inside the shell script" echo " here are the input parameters" .......................... .................. ... (11 Replies)
Discussion started by: gvkumar25
11 Replies

9. Shell Programming and Scripting

The Shell lost the inverted comma in a nested ssh command

Hi, i want use this Comand for my psql request sh ssh -o StrictHostKeyChecking=no rootatemailaddress.de sudo psql -U postgres -c "select pg_terminate_backend(pid) from pg_stat_activity where datnam=\'$DB\';"'" but the shell lost the inverted comma for datnam=\'$DB\'. The request deliver... (2 Replies)
Discussion started by: peterpane007
2 Replies
DAEMON(3)						   BSD Library Functions Manual 						 DAEMON(3)

NAME
daemon -- run in the background LIBRARY
Standard C Library (libc, -lc) SYNOPSIS
#include <stdlib.h> int daemon(int nochdir, int noclose); DESCRIPTION
The daemon() function is for programs wishing to detach themselves from the controlling terminal and run in the background as system daemons. Unless the argument nochdir is non-zero, daemon() changes the current working directory to the root (/). Unless the argument noclose is non-zero, daemon() will redirect standard input, standard output, and standard error to /dev/null. RETURN VALUES
The daemon() function returns the value 0 if successful; otherwise the value -1 is returned and the global variable errno is set to indicate the error. ERRORS
The daemon() function may fail and set errno for any of the errors specified for the library functions fork(2) and setsid(2). SEE ALSO
fork(2), setsid(2), sigaction(2) HISTORY
The daemon() function first appeared in 4.4BSD. CAVEATS
Unless the noclose argument is non-zero, daemon() will close the first three file descriptors and redirect them to /dev/null. Normally, these correspond to standard input, standard output, and standard error. However, if any of those file descriptors refer to something else, they will still be closed, resulting in incorrect behavior of the calling program. This can happen if any of standard input, standard out- put, or standard error have been closed before the program was run. Programs using daemon() should therefore either call daemon() before opening any files or sockets, or verify that any file descriptors obtained have values greater than 2. The daemon() function temporarily ignores SIGHUP while calling setsid(2) to prevent a parent session group leader's calls to fork(2) and then _exit(2) from prematurely terminating the child process. BSD
June 9, 1993 BSD
All times are GMT -4. The time now is 07:11 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy