[kwlug-disc] ssh into remote with initial command, and stick!

Khalid Baheyeldin kb at 2bits.com
Thu May 23 09:16:07 EDT 2013


Then here is your solution:

ssh -t login at host 'top; bash'

So, you send a pipeline, once top exits, a shell is invoked and stays there
for you.

On Thu, May 23, 2013 at 12:54 AM, unsolicited <unsolicited at swiz.ca> wrote:

> The remote shell should stay in place once top is exited with 'q'.
>
>
> On 13-05-22 09:38 PM, Khalid Baheyeldin wrote:
>
>> I deleted your original email, so lost some details here.
>>
>> But this works for me:
>>
>> ssh -t login at host top
>>
>> Without a bash -c
>>
>> That gives me a working top. When I press q the remote command exits and I
>> get disconnected. Works as designed.
>>
>> If you want it to show you just one refresh of top, then use
>>
>> ssh -t login at host 'top -b -n1'
>>
>> On Wed, May 22, 2013 at 9:29 PM, unsolicited <unsolicited at swiz.ca> wrote:
>>
>>  But what is causing the initial difficulty?
>>>
>>> It doesn't seem unreasonable to give ssh an initial command to run, such
>>> as bash, and to give bash an initial command to run, such as top.
>>>
>>> What am I missing / misunderstanding?
>>>
>>>
>>> On 13-05-22 07:32 PM, Khalid Baheyeldin wrote:
>>>
>>>  If what Paul said is what you want, then just create a ~/.screenrc file
>>>> and
>>>> put these two lines in it:
>>>>
>>>> screen -t shell    1 bash # This is just a shell
>>>> screen -t top      2 bash -c top # This is your top
>>>>
>>>> Top will be in the 2nd "window".
>>>>
>>>>
>>>
>>> ______________________________****_________________
>>> kwlug-disc mailing list
>>> kwlug-disc at kwlug.org
>>> http://kwlug.org/mailman/****listinfo/kwlug-disc_kwlug.org<http://kwlug.org/mailman/**listinfo/kwlug-disc_kwlug.org>
>>> <**http://kwlug.org/mailman/**listinfo/kwlug-disc_kwlug.org<http://kwlug.org/mailman/listinfo/kwlug-disc_kwlug.org>
>>> >
>>>
>>>
>>
>>
>>
>>
>> ______________________________**_________________
>> kwlug-disc mailing list
>> kwlug-disc at kwlug.org
>> http://kwlug.org/mailman/**listinfo/kwlug-disc_kwlug.org<http://kwlug.org/mailman/listinfo/kwlug-disc_kwlug.org>
>>
>>
>
> ______________________________**_________________
> kwlug-disc mailing list
> kwlug-disc at kwlug.org
> http://kwlug.org/mailman/**listinfo/kwlug-disc_kwlug.org<http://kwlug.org/mailman/listinfo/kwlug-disc_kwlug.org>
>



-- 
Khalid M. Baheyeldin
2bits.com, Inc.
Fast Reliable Drupal
Drupal optimization, development, customization and consulting.
Simplicity is prerequisite for reliability. --  Edsger W.Dijkstra
Simplicity is the ultimate sophistication. --   Leonardo da Vinci
For every complex problem, there is an answer that is clear, simple, and
wrong." -- H.L. Mencken
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://kwlug.org/pipermail/kwlug-disc_kwlug.org/attachments/20130523/36778779/attachment.htm>


More information about the kwlug-disc mailing list