Sponsored Content
Top Forums Shell Programming and Scripting Reading file from remote system and work on it locally Post 302498717 by pludi on Tuesday 22nd of February 2011 09:25:21 AM
Old 02-22-2011
As always: it depends. It depends on the type of the remote system and the local system, and what services are available? Can you access the remote side using SSH/FTP/CIFS/NFS/...? What tool will you use to further process the file? Which side has more processing power available? How fast is the network between the two?

For example, with a fast network, a quick local machine, and SSH access I'd do something like this:
Code:
ssh user@remote 'cat /path/to/file' | while read line; ...

On a slow network, with enough processing capability on the remote side I'd let that machine do the processing and only transfer the results:
Code:
ssh user@remote 'while read line; do ...; done < /path/to/file'

This User Gave Thanks to pludi For This Post:
 

10 More Discussions You Might Find Interesting

1. Filesystems, Disks and Memory

reading unix file system from windows

I found a more appropriate section to post my question. Thanks! (0 Replies)
Discussion started by: cneill
0 Replies

2. UNIX for Dummies Questions & Answers

how to mount a file system of a remote machine to local file system

Hi friends, In my case, there are serveral PCs running Linux in a LAN. I would like to to mount the directory /A_river of machine-A to the file system of another machine machine-B so that I can access files in that directory. I do not know how to do this. The situation is complicated by... (2 Replies)
Discussion started by: cy163
2 Replies

3. UNIX and Linux Applications

invoke remote graphical application..and display locally

Hi, I want to invoke(run) a graphical application remotely, and the display should be in remote itself. (no X redirect).i want to do this through ssh. like if i login to a remote machine and run firefox it should display there itself. how can i do this..? (2 Replies)
Discussion started by: madhusudankh
2 Replies

4. UNIX for Advanced & Expert Users

Using remote rsync, but copy locally?

I'm looking to use rsync to compare remote files and to copy the diff to a local directory, rather than transfer over the net. The net connection is not fast enough to transfer these files (~1.8TB) and I'd like to sneakernet them instead. Possible? (4 Replies)
Discussion started by: dfbills
4 Replies

5. Shell Programming and Scripting

Reading file from remote host?

flamingo:~ jnojr$ ssh -t macbook sudo -v Password: Connection to macbook closed. flamingo:~ jnojr$ ssh -t macbook sudo cat /etc/cma.conf | grep CMABuildNumber <CMABuildNumber>2918</CMABuildNumber> Connection to macbook closed. flamingo:~ jnojr$ ssh -t macbook sudo -k Connection to macbook... (3 Replies)
Discussion started by: jnojr
3 Replies

6. Shell Programming and Scripting

Editing a file on remote server using shell script locally

Hi All, I have below requirements for my project: 1. Building a shell script which connects to a remote server 2. running script on local machine as user 'A' 3. connecting to server using user 'B' with password 4. login with a powerbroker role 'P' (asks for same password as 'B') on that... (1 Reply)
Discussion started by: Nishant Ladiwal
1 Replies

7. Shell Programming and Scripting

Editing a file on remote server using shell script locally

Hi Scott, My previous post was not for any school or college projects. I am currently working with a IT company (Cannot provide more details than this). I am trying to implement the below script in my day-to-day work, Apologies for the confusion in previous post :). My question remains same... (4 Replies)
Discussion started by: Nishant Ladiwal
4 Replies

8. Shell Programming and Scripting

SSH - remote output locally

The code below works ok, however; I need to output the results to a local variable the_path="/mnt/back/hang" ssh -T -i /home/buddy/.ssh/id_rsa buddy@ginger << EOF find ${the_path} -name "*.jpg" | wc -l > ## output to local variable exit EOF (3 Replies)
Discussion started by: squrcles
3 Replies

9. Shell Programming and Scripting

Ssh remote command doesn't work from script file

I have 10 application servers in a distributed architecture generating their own application logs. Each server has application utility to continuously tail the log. for example following command follows tails and follows new logfiles as they are generated server1$ logutility logtype When I run... (8 Replies)
Discussion started by: indianya
8 Replies

10. Shell Programming and Scripting

Read file input in while loop does not work on AIX system

I'm working on Aix 6.1 and using ksh shell. The below works fine on Linux bash or ksh shell . while IFS= read -r dirpath ; do echo "Hi" done <<<"$var" However, any such while loop that reads the input from file or variable using <<< fails on Aix system with the below error: Below... (2 Replies)
Discussion started by: mohtashims
2 Replies
HWLOC-ASSEMBLER-REMOTE(1)					       hwloc						 HWLOC-ASSEMBLER-REMOTE(1)

NAME
hwloc-assembler-remote - Assemble multiple remote host topologies SYNOPSIS
hwloc-assembler-remote [options] output.xml host1 host2 ... OPTIONS
--ssh <ssh> Use the given ssh command (and options) to connect to remote hosts. --lstopo-path <path> Use the given path as the remote lstopo command when gathering remote topologies. By default, lstopo is taken from the PATH envi- ronment variable. --lstopo-opts <opts> Pass the given lstopo options when gathering remote topologies. --show Display the resulting topology before exit. -f --force Ignore failure to load a remote host topology. DESCRIPTION
hwloc-assembler-remote is a frontend to hwloc-assembler. It takes care of retrieving the remote nodes' topologies before assembling them with hwloc-assembler. EXAMPLES
To assemble three nodes topologies: $ hwloc-assembler-remote output.xml host1 host2 host3 To assemble the topology of a multi-process MPI job defined as a machinefile: $ hwloc-assembler-remote output.xml `cat machinefile | sort | uniq` RETURN VALUE
Upon successful execution, hwloc-assembler-remote returns 0. hwloc-assembler-remote will return nonzero if any kind of error occurs, such as (but not limited to) failure to parse the command line. SEE ALSO
hwloc(7), lstopo(1), hwloc-assembler(1) 1.7 Apr 07, 2013 HWLOC-ASSEMBLER-REMOTE(1)
All times are GMT -4. The time now is 07:03 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy