Re: help with text-append over SSH ? - dd: unknown operand >>
On 2007-10-12 16:43, Juri Mianovich <[EMAIL PROTECTED]> wrote: >--- Giorgos Keramidas <[EMAIL PROTECTED]> wrote: >>On 2007-10-11 16:49, Juri Mianovich >><[EMAIL PROTECTED]> 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 [EMAIL PROTECTED] 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 [EMAIL PROTECTED] "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 ? Then you are not running a 'standard shell', but some sort of local hack and/or wrapper: kobe-> ssh server "echo 'hello world' > foo" kobe-> ssh server "od -c foo" 000 h e l l o w o r l d \n 014 kobe-> echo hello new world | ssh server "dd >> foo" 0+1 records in 0+1 records out kobe-> ssh server "od -c foo" 000 h e l l o w o r l d \n h e l l 020 o n e w w o r l d \n 034 kobe-> I'm sorry, but I don't think you can get effective "help" from the FreeBSD lists. You will have to ask for specific guidelines and help from your hosting provider. Anything else will be guesswork and may break without any sort of notice in the future, when your host decides to install a "new" "security fix" to their custom shell. - Giorgos ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "[EMAIL PROTECTED]"
Re: help with text-append over SSH ? - dd: unknown operand >>
On Saturday 13 October 2007 12:08:16 Svein Halvor Halvorsen wrote: > I want to append the contents of a local text file > >>> > >>> to the contents of > >>> > a remote text file, over SSH. > > Andrew Pantyukhin wrote: > > cat file1 | ssh [EMAIL PROTECTED] "dd -of file2" > > That will replace the contents of file2, not append it. Also it > should be "dd of=file1". However, you can use "seek=n" to append, > like this: > > cat file1 | ssh remote "dd of=file2 seek=n" > > ... where n is the length of file2 or better: cat file1 | ssh remote "dd of=file2 conv=notrunc" -- Mel ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "[EMAIL PROTECTED]"
Re: help with text-append over SSH ? - dd: unknown operand >>
I want to append the contents of a local text file >>> to the contents of a remote text file, over SSH. : Andrew Pantyukhin wrote: > cat file1 | ssh [EMAIL PROTECTED] "dd -of file2" That will replace the contents of file2, not append it. Also it should be "dd of=file1". However, you can use "seek=n" to append, like this: cat file1 | ssh remote "dd of=file2 seek=n" ... where n is the length of file2 ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "[EMAIL PROTECTED]"
Re: help with text-append over SSH ? - dd: unknown operand >>
On Fri, Oct 12, 2007 at 04:43:38PM -0700, Juri Mianovich wrote: > > --- Giorgos Keramidas <[EMAIL PROTECTED]> > wrote: > > > On 2007-10-11 16:49, Juri Mianovich > > <[EMAIL PROTECTED]> 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 [EMAIL PROTECTED] 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 [EMAIL PROTECTED] "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 [EMAIL PROTECTED] "dd -of file2" ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "[EMAIL PROTECTED]"
Re: help with text-append over SSH ? - dd: unknown operand >>
--- Giorgos Keramidas <[EMAIL PROTECTED]> wrote: > On 2007-10-11 16:49, Juri Mianovich > <[EMAIL PROTECTED]> 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 [EMAIL PROTECTED] 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 [EMAIL PROTECTED] "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 ? Check out the hottest 2008 models today at Yahoo! Autos. http://autos.yahoo.com/new_cars.html ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "[EMAIL PROTECTED]"