I have a script that looks like the following:  ssh host command1 scp file1 host:/tmp ssh host command2   Is there a way to combine them all in one ssh/scp call? The problem I have is combining copying files with executing commands, which has to be done interleaved. Was hoping for something like:   ssh_sometool host -c command1 -cp file1 /tmp -c command2   It's not about the syntax ( I could write a function like that), it's about everything happening within the same ssh session
Possible Duplicate:          Here is my sync script:  ssh user@remote.host /etc/init.d/some_service stop scp user@remote.host:/var/some_service/events ./events scp ./new_data user@remote.host:/var/some_service/new_data ssh user@remote.host /etc/init.d/some_service start   As You can see, it stops service, perform some copies with scp and starts service back.  The problem: it "costs" 4 "similar" ssh connections in a row.  Is there any way to make all the work, using one physical ssh connection?
Checking if a double (or float) is NaN in C++ Systems of linear differential equations - eigenvectors calculating mean of a random variable raised to a power Consider there is a box of mass $m$ at rest on the floor. Most books give an example that we need to do a work of $mgh$ to lift the box $h$ upward.  If we analyze this work done, the external force acting on the box by us should be equal to the weight of the box. Therefore the net force is zero which in turn there is no acceleration. If there is no acceleration and the initial velocity of the box is also zero, how can the box move upward? In  when Ambassador Sarek became critically ill, why didn't they send him home or send for a Vulcan medical expert? Since they were hosting many prominent political figures from many races, it seems strange that they did not have much medical support for a race so common as Vulcans (who are part of the Federation). Work the Spring There's a book that I read several years ago that I'd like to find.  However, I cannot remember enough about it to find it myself.  Neither the title nor author remain in my mind, nor any keyword or phrase that's unique enough for the Grand Google to nail for me.  Hence my desperate plea here.  In the book, there is an interstellar civilization composed of several power blocks.  The entire civilization did not fill the galaxy, but it did span several stellar systems.  Maybe 10s or 100s.  I seem to remember that one of the civilizations was a decentralized group referred to as the Brotherhood and they seemed to have been keen on preserving old learning and political ideals.  A derelict alien spacecraft from outside all of this had been discovered and at least two of the power blocks sent ships to recover it.  I don't recall if they knew at the time about the power the alien ship had, but they must have had some clue since there was some urgency in capturing this ship.  One of the ships sent to capture the Alien craft was commanded by somebody who was rather shaken up, to say the least.  He had had some big trauma in his past (like... the last ship he captained was annihilated with all hands.) so he was kinda bummed out about things and wasn't really putting his heart into getting this done.  He was assisted by the ship's AI who had a lot of soul-to-soul chats with the captain, and at one point almost relieved him of command because he was just not getting the job done.  I think the ship's name was Boaz.  These were the "good guys".  There was at least one other ship sent from the "bad guys."  The alien craft had some remarkable powers.  The interior volume was apparently infinite and the operators could see and manipulate anything in the universe.  There might have been some example given where all the rats somewhere were found and disposed of.  Whoever had control was tempted by the ole absolute power corrupts absolutely problem, but nobody but nobody could stop them because of their power.  They could eat and multiply within the ship and become real bad-asses.  But alas... (or hurray, depending upon which side you're one) everything fails eventually, and whoever controlled the ship would eventually succumb to some horrible end.  Whereupon the ship became derelict again until some other lucky race found it and repeated the cycle.  The ship had an AI that was real interested in taking the power for itself, but there was some mechanical, spring-loaded, mechanism outside of its control that needed to be worked in order to execute power.  The AI apparently never figured out how to "work the spring" and this made him crazy angry.  The ending is equally foggy for me.  I'm pretty sure the good guys got the ship.  They agonized over what to do with it.  Apparently it was indestructable and nobody wanted to taste the temptation of all that power.  In the end they dumped it on the surface of a neutron star.  There it sat forever more, probably with the crazy AI really pissed off about being there.  If you've read this book, you'll recognize it immediately from these clues.  I'm looking forward to finding out the name of this book.  Thanks! Dobble card game - mathematical background In  there is a deck of 55 cards. Each of them has 8 symbols on it. There is a total of 50 different symbols and each two cards have one and only one in common.  I am wondering, given a total number of symbols N and a number of symbols on each card K, how do you find the biggest number of cards such that:   on each of those cards there are exactly K of the N symbols, every two cards have one and only one symbol in common. How do I enable auto-login in LightDM? I want user foo to auto-login using LightDM (which has been used by Ubuntu since version 11.10). How would I do that? macOS Sierra restarting download instead of resuming Relationship between SVD and PCA. How to use SVD to perform PCA? How to export variable for use with sudo? On Slackware, using sbopkg permits one to build a package from source. Repos is not big as Debian, but it's nice.  Some software can use environment variables, for example on the VICE c64 emulator, if the variable FFMPEG is set to yes, it will enable ffmpeg recording the emulator.  I tried to use  $ export FFMPEG=yes; sudo sbopkg -B -i vice   but ffmpeg is disabled.  Instead I had to use  $ su - $ export FFMPEG=yes $ sbopkg -B -i vice   which works.  How to use environment variables with sudo? Hyphen or no hyphen when modifying an adjective with a quantity? Is there an official rule that the minimum damage can't be negative? What does the following for loop syntax mean in C? Implicit 'which is', 'which are' A new study has shown that millions of pieces of junk floating in  space could be a big hazard for satellites orbiting Earth.   Is there an implicit 'which are' in front of floating in space? Why is 'which are'  not written? How to install MariaDB? Did spacetime start with the Big bang? Did spacetime start with the Big Bang?  I mean, was there any presence of this spacetime we are experiencing now before big bang? And could there be a presence/existence of any other space-time before the big bang? Apparently you can easily obtain a client IP address in WCF 3.5 but not in WCF 3.0.  Anyone know how? Why does C# disallow readonly local variables? Which edit actions can move a post into Community Wiki mode? Surprisingly, I couldn't find a straight answer to this.  It's not entirely clear in the .  There are (at least?) four different types of edit actions:   Body edits Title edits Retags Rollbacks   And a few actions that show up in the history but aren't really "edits":   Close/Reopen Delete/Undelete   The FAQ seems to indicate that only body edits are important as far as "wikification" is concerned, but I'm not sure if that's really correct or if I'm just interpreting the post too literally.  The FAQ also says that rollbacks don't reverse the calculations - fine, but are they considered to be additional edits or are they ignored?  Can anyone tell me which of these actually count toward the wikification of a post, and whether the rules are any different for owner edits vs. multiple editors?