ATTN: Programmers, Need HELP with shell script... - FirebirdV6.com/CamaroV6.com Message Board

Announcement

Collapse
No announcement yet.

ATTN: Programmers, Need HELP with shell script...

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • ATTN: Programmers, Need HELP with shell script...

    Im trying to write a script which works as follows:

    machine A (where my script is)
    machine B (the machine where I'm trying to SSH)

    while script runs on A, I'm trying to ssh B, and collect data from a file on B and copy it to a file on A.

    ---------------------------------------------

    I've tried backgrounding the SSH but this alone is not working. :(
    Once i ssh, I'm considering entering machine B. (the script hangs at new host B)

    Any ideas on how to code this?

    Thanks in advance for any input!
    *OneQuickSix*<br />1998 3.8L V-6 Camaro<br />~A4 w/Y87~

  • #2
    ssh really isnt scriptable. you might be able to do something stupid like:

    ssh me@remotehost cat my_file_on_remote_host &gt; /tmp/oh_look_my_file_from_remote_host

    however, it looks like you just want to bring a file over from host b, so use scp "ssh cp" instead.

    scp me@remotehost:my_file_there my_file_here

    do need something more complicated? perhaps grabbing the last few lines of a logfile?

    ssh me@remotehost tail -10 logfile_on_remotehost &gt; last_10_lines_of_logfile_from_remotehost

    [edit: you could probably script ssh with expect if you really really needed some sort of programmatic control over ssh.]

    [ January 06, 2005, 11:40 PM: Message edited by: chas ]

    Comment


    • #3
      Chas,

      Thanks for the ideas.

      I figured out how to do copy files over using ssh:

      ssh {remote host ip} cat {file name on remote host} &gt;&gt; {file name on host}

      This works fine. But I am now trying to figure out how to execute a script on the remote host (B) from the host machine (A). Basically, I want the main script to envoke the other script (located on remote host).

      I tried the same type of code as above to do this, but it doesn't work since I am not using a system command (like "cat" above)

      Any other suggestions?

      Thanks again for all your help.

      [img]graemlins/wavey.gif[/img]
      *OneQuickSix*<br />1998 3.8L V-6 Camaro<br />~A4 w/Y87~

      Comment


      • #4
        haxxxor spyy

        Comment

        Latest Topics

        Collapse

        • Dongrossmd
          Throttle Position Sensor trouble shooting
          by Dongrossmd
          I’m new. I actually don’t own a Camaro or firebird. I do have a 2000 Camaro 3.8 fly by throttle and 4l60e. This is installed in a 1980 Triumph TR7...
          2 weeks ago
        • ssms5411
          New stereo
          by ssms5411
          Not much going on, replaced my Kenwood double din stereo with a Pioneer double din, the Kenwood had problems. Then replaced my power inverter for my reverse...
          3 weeks ago

        FORUM SPONSORS

        Collapse
        Working...
        X