Latest LQ Deal: Linux Power User Bundle
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 08-23-2014, 07:43 AM   #1
LQ Newbie
Registered: Jul 2014
Posts: 4

Rep: Reputation: Disabled
storing value from a file into a variable from one server to another

I have 2 servers eg. serverA and serverB which are connected with a passwordless authentication. There is a file in serverA, lets say file 'abc' which contains "line1". Now I want to store this "line1" into a variable in serverB. can anyone help me with the command
thanks in advance.
Old 08-24-2014, 06:20 AM   #2
LQ Guru
Registered: Mar 2004
Distribution: Slackware
Posts: 5,690

Rep: Reputation: 510Reputation: 510Reputation: 510Reputation: 510Reputation: 510Reputation: 510
From server B
myvar=$(ssh serverA "cat abc")


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
storing the value of echo in a variable jone kim Linux - Newbie 2 01-30-2014 06:50 AM
Need help with script writing: Storing cmd in variable, print variable, then exe cmds Arodef Programming 3 01-17-2012 01:26 AM
Linux File Server storing data in DOS/WINDOWS format FineArt0104 Linux - Server 7 12-29-2011 05:58 AM
Storing table in variable DeepSeaNautilus Linux - Software 5 04-04-2009 02:45 PM
Storing part of a filename as a variable VTGuitarMan Programming 5 03-12-2008 07:47 AM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 11:38 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration