File transfer to a pipe


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting File transfer to a pipe
# 1  
Old 12-13-2007
File transfer to a pipe

We were using ftp before and were able to pipe our files
get a1 p1 where p1 is pipe
this way we did not have to store files on our local server.

Now we are using sftp2 and in sftp2 get and mget are synonymous. When I do

get a1 p1

I get error p1: No such file or directory (it's looking for p1 on remote server)

I tried using scp (scp2) but it overwrites pipe with physical file.

Is there any other utility I can use to transfer file and read it in a pipe?

thanks
# 2  
Old 08-18-2008
I think this will do what you are asking...

This command will take "testfile" and transfer it to another box with ip_address

cat testfile | ssh -l username ip_address "cat > testfile"

So lets say you have an app called "parse_testfile.pl" on the remote box (ip_address) that you wanna pipe the file to:

cat testfile | ssh -l username ip_address "cat | parse_testfile.pl"

The only downfall to using SSH to do this is the encryption overhead.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

File transfer

When using FTP to transfer a file from IBM iSeries family of servers client to a non IBM Iseries family server, files might have characters appear in the wrong format Eg | in Iseries and while transferring fro Iseries system to Linux , but instead of | it is showing as ?. Please advise (3 Replies)
Discussion started by: sudhainit
3 Replies

2. Shell Programming and Scripting

How to cut a pipe delimited file and paste it with another file to form a comma separated outputfile

Hello ppl I have a requirement to split (cut in unix) a file (A.txt) which is a pipe delimited file into A1.txt and A2.txt Now I have to join (paste in unix) this A2.txt with external file A3.txt to form output file A4.txt which should be CSV (comma separated file) so that third party can... (25 Replies)
Discussion started by: etldev
25 Replies

3. Shell Programming and Scripting

How to ignore Pipe in Pipe delimited file?

Hi guys, I need to know how i can ignore Pipe '|' if Pipe is coming as a column in Pipe delimited file for eg: file 1: xx|yy|"xyz|zzz"|zzz|12... using below awk command awk 'BEGIN {FS=OFS="|" } print $3 i would get xyz But i want as : xyz|zzz to consider as whole column... (13 Replies)
Discussion started by: rohit_shinez
13 Replies

4. Shell Programming and Scripting

Avoiding file overwrite during file transfer using scp

Hi, I have written a small script to transfer a file from one unix server to other using scp command which is working fine. As I know with scp, if any file with the same name is already present on destination server, it would get overwritten without any notification to user. Could anyone help me... (14 Replies)
Discussion started by: dsa
14 Replies

5. UNIX for Dummies Questions & Answers

Pipe binary file matches grep results to file

I am using grep to match a pattern, but the output is strange. $ grep -r -o "pattern" * Gives me: Binary file foo1 matches Binary file foo2 matches Binary file foo3 matches To find the lines before/after, I then have to use the following on each file: $ strings foo1 | grep -A1 -B1... (0 Replies)
Discussion started by: chipperuga
0 Replies

6. Shell Programming and Scripting

Convert CSV file (with double quoted strings) to pipe delimited file

Hi, could some help me convert CSV file (with double quoted strings) to pipe delimited file: here you go with the same data: 1,Friends,"$3.99 per 1,000 listings",8158here " 1,000 listings " should be a single field. Thanks, Ram (8 Replies)
Discussion started by: Ram.Math
8 Replies

7. Programming

File transfer in C

HI Can anyone provide me with codes for file transfer server to client or vice versa? Also please explain how to compile those programs in ubuntu terminal as i am totally new to socket programming. Thanks (0 Replies)
Discussion started by: mayhemtrigger
0 Replies

8. Shell Programming and Scripting

broken pipe for ftp file transfer

hi i am trying to connect to a remote server and trying to uploa a file. during upload i am getting ":Broken pipe" error please help (0 Replies)
Discussion started by: Satyak
0 Replies

9. UNIX for Dummies Questions & Answers

Transfer the file

Dear all, Can anybody let me know how to automate a file transfer process to a remote m/c thru SFTP , automate means it will not prmpt for password. how i am going to achive this....and what all methods are available or tools are available ???? (2 Replies)
Discussion started by: manas_ranjan
2 Replies

10. Shell Programming and Scripting

file transfer

hi all how do i copy a file from one server to another thanks bkan77 (4 Replies)
Discussion started by: bkan77
4 Replies
Login or Register to Ask a Question