Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 13 Oct 2007 03:59:54 +0400
From:      Andrew Pantyukhin <infofarmer@FreeBSD.org>
To:        Juri Mianovich <juri_mian@yahoo.com>
Cc:        Giorgos Keramidas <keramida@ceid.upatras.gr>, freebsd-questions@freebsd.org
Subject:   Re: help with text-append over SSH ? - dd: unknown operand >>
Message-ID:  <20071012235953.GB1554@amilo.cenkes.org>
In-Reply-To: <687623.75032.qm@web45604.mail.sp1.yahoo.com>
References:  <20071012143730.GC3881@kobe.laptop> <687623.75032.qm@web45604.mail.sp1.yahoo.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Fri, Oct 12, 2007 at 04:43:38PM -0700, Juri Mianovich wrote:
> 
> --- Giorgos Keramidas <keramida@ceid.upatras.gr>
> wrote:
> 
> > On 2007-10-11 16:49, Juri Mianovich
> > <juri_mian@yahoo.com> 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"
> 
> Thank you - I do indeed need to use 'dd' because I
> don't have access to 'cat' in the chroot.
> 
> However, when I use your example, I get this error:
> 
> dd: unknown operand >>
> 
> So I have something off a bit ... help ?

cat file1 | ssh user@host "dd -of file2"



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20071012235953.GB1554>