Re: cron and ssh

From: Chad Lemmen (chadl_at_lemmen.com)
Date: 07/30/04

  • Next message: D. Thomas Podnar: "Re: Long file pathnames created by system"
    Date: Fri, 30 Jul 2004 14:24:30 GMT
    
    

    Chad Lemmen <chadl@lemmen.com> wrote:
    > I can get it to work using the three commands below, but it would be nice
    > to do it in just one command like you have above.
    >
    > #!/bin/sh
    > scp linuxhost:parseshell/price.prn price.prn
    > cat price.prn >> /path_on_sco/dtnprice.prn
    > ssh linuxhost 'rm parseshell/price.prn'

    I'm getting the "Select: invalid argument" error with the above commands
    also, but the transfer does work so I guess that error has nothing to
    do with the problem.

    Some more testing has revealed this

    ssh linuxhost 'cat parseshell/price.prn' >> /path_on_sco/dtnprice.prn

    The above works on the command line. If I use the -n option on the
    command line then /path_on_sco/dtnprice.prn is an empty file after
    running the command.

    ssh -n linuxhost 'cat parseshell/price.prn' >> /path_on_sco/dtnprice.prn

    The -n option on ssh prevents reading from stdin. Now when cron runs the
    script it doesn't matter if I used the -n option or not stdin is not read.
    I think for this command to work I need stdin to be read so I guess it
    just won't work with cron?


  • Next message: D. Thomas Podnar: "Re: Long file pathnames created by system"

    Relevant Pages

    • Re: noobish dsadd computer script question
      ... I do not understand how the Active Directory Command ... Line Interface accepts information from a file using STDIN. ... Judging from the text in the book and the text in the DSADD help file, ...
      (microsoft.public.windows.server.scripting)
    • RE: What is the source of my input, file or STDIN?
      ... I could have been more explicit in my question to have stated that ... command line or if not invoked as the recipient of piped output. ... no command line args - switching to STDIN ... If input stream is not coming from STDIN, but a file, how can one ...
      (perl.beginners)
    • Re: Editable input from the console windows
      ... stdin, stdout, and stderror in relationship to pipe commands. ... I understand the fundamentals behind redirection. ... The exec command adds to the confusion as well. ... I learning the syntax and build upon a previously working script. ...
      (comp.unix.shell)
    • Re: noobish dsadd computer script question
      ... I do not understand how the Active Directory Command ... Line Interface accepts information from a file using STDIN. ... Judging from the text in the book and the text in the DSADD help file, ... as your file separates the names with carriage ...
      (microsoft.public.windows.server.scripting)
    • Re: noobish dsadd computer script question
      ... I do not understand how the Active Directory Command ... Line Interface accepts information from a file using STDIN. ... Judging from the text in the book and the text in the DSADD help file, ... as your file separates the names with carriage ...
      (microsoft.public.windows.server.scripting)