From owner-freebsd-questions@FreeBSD.ORG Fri Oct 12 14:38:33 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 3074716A46D for ; Fri, 12 Oct 2007 14:38:33 +0000 (UTC) (envelope-from keramida@ceid.upatras.gr) Received: from igloo.linux.gr (igloo.linux.gr [62.1.205.36]) by mx1.freebsd.org (Postfix) with ESMTP id 7A5D613C494 for ; Fri, 12 Oct 2007 14:38:32 +0000 (UTC) (envelope-from keramida@ceid.upatras.gr) Received: from kobe.laptop (vader.bytemobile.ondsl.gr [83.235.244.135]) (authenticated bits=128) by igloo.linux.gr (8.14.1/8.14.1/Debian-9) with ESMTP id l9CEbr4J031167 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Fri, 12 Oct 2007 17:38:18 +0300 Received: from kobe.laptop (kobe.laptop [127.0.0.1]) by kobe.laptop (8.14.1/8.14.1) with ESMTP id l9CEbXDX004211; Fri, 12 Oct 2007 17:37:49 +0300 (EEST) (envelope-from keramida@ceid.upatras.gr) Received: (from keramida@localhost) by kobe.laptop (8.14.1/8.14.1/Submit) id l9CEbUNN004210; Fri, 12 Oct 2007 17:37:30 +0300 (EEST) (envelope-from keramida@ceid.upatras.gr) Date: Fri, 12 Oct 2007 17:37:30 +0300 From: Giorgos Keramidas To: Juri Mianovich Message-ID: <20071012143730.GC3881@kobe.laptop> References: <561095.99967.qm@web45614.mail.sp1.yahoo.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <561095.99967.qm@web45614.mail.sp1.yahoo.com> X-Hellug-MailScanner: Found to be clean X-Hellug-MailScanner-SpamCheck: not spam, SpamAssassin (not cached, score=-3.982, required 5, autolearn=not spam, ALL_TRUSTED -1.80, AWL 0.42, BAYES_00 -2.60) X-Hellug-MailScanner-From: keramida@ceid.upatras.gr X-Spam-Status: No Cc: freebsd-questions@freebsd.org 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 14:38:33 -0000 On 2007-10-11 16:49, 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' ? Try running: cat file1 | ssh user@host "dd >> file2"