ssh in bash script

From: rado (rado_at_rivers-bend.com)
Date: 04/05/05

  • Next message: Thomas Cameron: "Re: Fedora core 3 install"
    To: fedora <fedora-list@redhat.com>
    Date: Tue, 05 Apr 2005 15:08:40 +0000
    
    

    hi guys!
    ssh already keyed for passwordless.
    from shell prompt I can:

    # ssh host2

    the shell in host 2 is spawned and am now at host2's prompt.

    # run command
    I want the exit code from what I just ran

    # exit
    back at prompt in host1.

    that's it! cake huh?

    ok in a script:

    it stops at the prompt as soon as it spawns the shell in host 2

    how to make it continue on in the script?

    also, since it's virgin territory for me.

    can I indeed just capture the exit code for a return value that I can
    pass on to the calling script, or if I decide, just to write the code
    inside the main script?

    thx,

    John Rose

    -- 
    ...and I woke up 2 days later, in the back yard, talkin to Elvis!
    -- 
    fedora-list mailing list
    fedora-list@redhat.com
    To unsubscribe: http://www.redhat.com/mailman/listinfo/fedora-list
    

  • Next message: Thomas Cameron: "Re: Fedora core 3 install"

    Relevant Pages

    • Re: problem with exit while using nohup
      ... when you run any command ending with &, it runs in background, that shell does not wait till it gets over and shell prompt is displayed immediately. ... as it is evident, the exit should cause the script to terminate,hence ...
      (comp.unix.shell)
    • Re: Question about script -- make typescript of terminal session
      ... Script started, file is abc.txt ... have anything to do with your prompt? ... - assuming that you are using GNU Bash as your shell - then it will ... about Windows or Cygwin; if it's an NTFS or FAT32 filesystem, ...
      (comp.unix.shell)
    • Re: MSH catching all objects and executing once.
      ... although just the ability to instanciate objects from script ... or prompt is excellent. ... MSH really is everything I wanted in a shell, ...
      (microsoft.public.windows.server.scripting)
    • Re: trap in shell programming
      ... For learning the shell, I suggest that you try trivial but useful _to_ ... Anything you can put in a script you can type at the prompt, ... I was running a CNC plasma cutter that's controlled by Windows XP. ...
      (Fedora)
    • Re: Can the configure script prompt for answers rather than autodetect?
      ... On 03/08/2009 08:38 PM, Mark Hobley wrote: ... makes decisions based on the build host. ... Is is possible to cause the configure script to prompt for the answers to all of the configuration ...
      (comp.os.linux.misc)