Sponsored Content
Top Forums Shell Programming and Scripting [SOLVED] put dd | ssh command in backgound Post 302703447 by Corona688 on Wednesday 19th of September 2012 06:31:25 PM
Old 09-19-2012
That's what $( ) does though -- turns its output into a string to put into a variable or command or what have you. If you don't need that, don't do that.

Code:
( dd if="$FDIR" bs=1024 2> /dev/null | ssh "$(whoami)@$SERVER" dd of="$TDIR" bs=1024 2> /dev/null ) < /dev/null > /dev/null 2>/dev/null &


# other stufff
# ...
# ...


wait # Wait for your background process to finish

 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Running a script in backgound

Hello everybody this is my new problem: I have a 'file1' as log of a process, y want to copy to 'file2' specific lines of the 'file1' when those lines are created in 'file1' that means in real time, i'm using the following command and it works: tail -f 'file1' | grep '_RESP' | grep -v... (7 Replies)
Discussion started by: Lestat
7 Replies

2. Shell Programming and Scripting

Cron Jobs Still Running In Backgound

Hi guys, I've got a few cron jobs ... porblem is they are running as intended but some of them just tend to stay there in sleeping mode for quite some time ... sometimes even days ... for example when i run the ps command i can see that some are still there although the same script had run many... (6 Replies)
Discussion started by: King Nothing
6 Replies

3. Shell Programming and Scripting

[Solved] passwordless SSH not working in one direction

Hi, I am trying to remove the password requirement when connecting with SSH. I have 1 server with Solaris 10 and 1 server with Solaris 9. I have created both keys on both servers, copied public key to the other server and created a file auithorixed_keys on both. I can successfully... (4 Replies)
Discussion started by: mcclunyboy
4 Replies

4. Shell Programming and Scripting

[solved] Killing 3rd command in ssh chain

Hi All, Noob question here... How do I kill the 3rd command in this ssh chain effectively? # ssh -t -t 10.80.0.5 'ssh 10.80.0.6 | /var/tmp/some_script' The "/var/tmp/some_script" contains: ssh 10.80.0.81 'echo "Hello World!!!!" >> /tmp/sample.txt'The problem is that once the sample.txt... (2 Replies)
Discussion started by: NYG71
2 Replies

5. Shell Programming and Scripting

[Solved] Using SSH in bash script

Hello, I am writing a script that has to log in to X number of servers over a full C class range. I am only keyed on a certain number of these servers and this can change from time to time. The part of my script that deals with this is for i in $(cat $server_list); do ssh ... (0 Replies)
Discussion started by: colinireland
0 Replies

6. Shell Programming and Scripting

run command with ssh[solved]

Hi all, Is it possible to make this possible ? $ echo $SKY_HOME /var/sink/SKY $ echo $SKY_HOME /home/smily/SKY $ ssh root@xyz "echo $SKY_HOME" root@xyz 's password: ****** /home/smily/SKY wrong output I was expecting the output as /var/sink/SKY (3 Replies)
Discussion started by: linuxadmin
3 Replies

7. Shell Programming and Scripting

SSH and Backticks [solved]

I have been testing a new script and cannot figure out why my `cat spath` will not execute on the remote machine? sudo ssh -p 22344 -o "PasswordAuthentication no" -o "HostbasedAuthentication yes" -l testuser 192.168.1.6 "find `cat spath` -depth" cat: spath: No such file or directory but... (0 Replies)
Discussion started by: metallica1973
0 Replies

8. Shell Programming and Scripting

[solved] Process ssh command in while loop

I have a script that reads a file containing a list of server names. It's suppose to loop through the list of names and execute a command on the remote server using ssh. It processes the ssh command for the first server in the list and then exits. Here's the code: #!/bin/bash ... (2 Replies)
Discussion started by: westmoreland
2 Replies

9. UNIX for Advanced & Expert Users

[Solved] SSH key authentication problem

Hi All, this is the very first time i am going to use SSH authentication. first i login to server@ and under this ..ssh directory of servera i used this following command: ssh-keygen -t rsa -b 1024 and i had 2 files(bravo_dbtest and bravo_dbtest.pub) created respectively, further i copied the... (13 Replies)
Discussion started by: lovelysethii
13 Replies

10. Shell Programming and Scripting

[Solved] Ssh to windows from linx

Hi, I was trying to ssh to windows server from linux box(red hat). I am a bit confused about where to generate the keys. Should I generate the keys in linux and place it in windows or other way around. I have installed openssh package in cygwin on the windows box. can someone please tell me... (0 Replies)
Discussion started by: ahmedwaseem2000
0 Replies
FDESCFS(5)						      BSD File Formats Manual							FDESCFS(5)

NAME
fdescfs -- file-descriptor file system SYNOPSIS
fdescfs /dev/fd fdescfs rw 0 0 DESCRIPTION
The file-descriptor file system, or fdescfs, provides access to the per-process file descriptor namespace in the global file system names- pace. The conventional mount point is /dev/fd. The file system's contents appear as a list of numbered files which correspond to the open files of the process reading the directory. The files /dev/fd/0 through /dev/fd/# refer to file descriptors which can be accessed through the file system. If the file descriptor is open and the mode the file is being opened with is a subset of the mode of the existing descriptor, the call: fd = open("/dev/fd/0", mode); and the call: fd = fcntl(0, F_DUPFD, 0); are equivalent. Flags to the open(2) call other than O_RDONLY, O_WRONLY and O_RDWR are ignored. Note: /dev/fd/0, /dev/fd/1 and /dev/fd/2 files are created by default when devfs alone is mounted. fdescfs creates entries for all file descriptors opened by the process. FILES
/dev/fd/# EXAMPLES
To mount a fdescfs volume located on /dev/fd: mount -t fdescfs null /dev/fd SEE ALSO
devfs(5), mount(8) HISTORY
The fdescfs file system first appeared in 4.4BSD. The fdescfs manual page first appeared in FreeBSD 2.2. AUTHORS
The fdescfs manual page was written by Mike Pritchard <mpp@FreeBSD.org>, and was based on the manual page written by Jan-Simon Pendry. BSD
September 18, 2010 BSD
All times are GMT -4. The time now is 01:08 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy