From owner-freebsd-questions@FreeBSD.ORG Fri Oct 12 12:17:53 2007 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C5F0216A419 for ; Fri, 12 Oct 2007 12:17:53 +0000 (UTC) (envelope-from tijl@ulyssis.org) Received: from thumbler.kulnet.kuleuven.ac.be (thumbler.kulnet.kuleuven.ac.be [134.58.240.45]) by mx1.freebsd.org (Postfix) with ESMTP id 76DBC13C4A6 for ; Fri, 12 Oct 2007 12:17:53 +0000 (UTC) (envelope-from tijl@ulyssis.org) Received: from localhost (localhost [127.0.0.1]) by thumbler.kulnet.kuleuven.ac.be (Postfix) with ESMTP id 04991138D01; Fri, 12 Oct 2007 14:17:51 +0200 (CEST) Received: from smtps02.kuleuven.be (smtpshost02.kulnet.kuleuven.be [134.58.240.75]) by thumbler.kulnet.kuleuven.ac.be (Postfix) with ESMTP id 423AF138B05; Fri, 12 Oct 2007 14:17:50 +0200 (CEST) Received: from kalimero.kotnet.org (kalimero.kotnet.org [10.4.16.222]) by smtps02.kuleuven.be (Postfix) with ESMTP id 03300F3862; Fri, 12 Oct 2007 14:17:50 +0200 (CEST) Received: from kalimero.kotnet.org (kalimero.kotnet.org [127.0.0.1]) by kalimero.kotnet.org (8.14.1/8.14.1) with ESMTP id l9CCHnxl002438; Fri, 12 Oct 2007 14:17:49 +0200 (CEST) (envelope-from tijl@ulyssis.org) X-Kuleuven: This mail passed the K.U.Leuven mailcluster From: Tijl Coosemans To: freebsd-questions@freebsd.org Date: Fri, 12 Oct 2007 14:17:37 +0200 User-Agent: KMail/1.9.7 References: <561095.99967.qm@web45614.mail.sp1.yahoo.com> In-Reply-To: <561095.99967.qm@web45614.mail.sp1.yahoo.com> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200710121417.49147.tijl@ulyssis.org> X-Virus-Scanned: by KULeuven Antivirus Cluster Cc: Juri Mianovich Subject: Re: help with text-append over SSH ? X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Oct 2007 12:17:53 -0000 On Friday 12 October 2007 01:49:04 Juri Mianovich wrote: > I have an account on a system where I cannot log in > over SSH, but I _can_ run a limited set of commands > remotely, over SSH. (I am in a jail of some sorts). > > I want to append the contents of a local text file to > the contents of a remote text file, over SSH. > > Normally, I would do this locally with: > > cat file1 >> file2 > > But again, file2 is remote, and I can't log in > there... I have access to the 'echo' command and the > 'dd' command (among others) on the remote host ... so > for instance, I can do things like this: > > ssh user@host rm -rf filename > > So, with all that in mind, how do I append the > contents of a local file to a remote file, over SSH, > using either 'echo' or 'dd' ? With echo or dd I don't know. With cat you can do it this way: cat file1 | ssh user@host "cat >> file2"