LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
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!

Notices


Reply
  Search this Thread
Old 08-23-2014, 06:43 AM   #1
mangeshs
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, 05:20 AM   #2
keefaz
LQ Guru
 
Registered: Mar 2004
Distribution: Slackware
Posts: 6,552

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


Reply



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 05:50 AM
Need help with script writing: Storing cmd in variable, print variable, then exe cmds Arodef Programming 3 01-17-2012 12:26 AM
Linux File Server storing data in DOS/WINDOWS format FineArt0104 Linux - Server 7 12-29-2011 04:58 AM
Storing table in variable DeepSeaNautilus Linux - Software 5 04-04-2009 01:45 PM
Storing part of a filename as a variable VTGuitarMan Programming 5 03-12-2008 06:47 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 10:22 PM.

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