On Wed, Dec 05, 2007 at 03:35:46PM -0800, David Brodbeck wrote: > > On Dec 5, 2007, at 3:16 PM, Michael Pobega wrote: >> tar cvvf foo.tar bar | ssh [EMAIL PROTECTED] "cat > foo.tar" >> >> Or am I doing it wrong (I most likely am)? I've never done any sort of >> piping through SSH before, so any sort of help would be appreciated. > > You're close. Try this: > > tar cvvf - bar | ssh -e none [EMAIL PROTECTED] "cat >foo.tar" > > Using - as the filename tells tar to output to stdout. "-e none" disables > SSH's escape character, making the session fully transparent -- otherwise > SSH will go into command mode if your tar output happens to contain a line > that starts with ~. >
I am not able to test it out now, but I'd like to know if my script will work. The lines in question are: aptitude search "~i!~M" | grep -v "i A" | awk '{print $2}' | ssh -e none [EMAIL PROTECTED] "cat >"$TIMEDIR/"aptitude.log" $TAR -cvvf - /$FILE | ssh -e none [EMAIL PROTECTED] "cat > "$TIMEDIR/$FILE.tar -- If programmers deserve to be rewarded for creating innovative programs, by the same token they deserve to be punished if they restrict the use of these programs. - Richard Stallman
signature.asc
Description: Digital signature