等同于ftp put和append in scp [英] equivalent of ftp put and append in scp

查看:173
本文介绍了等同于ftp put和append in scp的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个我无法理解的遗留脚本。

这个脚本是通过ftp将4个文件(2个ebcdic格式文件和2个pdf文件)通过ftp传输到大型机。

  ebcdic格式文件1是abc.xyz 
ebcdic格式文件2是pqr.xyz
pdf文件1是abc.pdf
pdf文件2是pqr.pdf
主机文件名是AM2P.BJCUN.SALCHG

语法该脚本中的命令如下:

 引用网站recfm = fb 
put /myfiles/abc.xyz AM2P .BJCUN.SALCHG
附加/myfiles/abc.pdf AM2P.BJCUN.SALCHG
附加/myfiles/pqr.xyz AM2P.BJCUN.SALCHG
附加/myfiles/pqr.pdf AM2P.BJCUN .SALCHG

我想通过SCP达到同样的效果。

有人可以告诉scp中put和append ftp的命令是什么吗?

解决方案

Put是普通的scp

  scp / path / to / source user @ host: / path / to / target 

附加功能只适用于一些小技巧(而不是直接与scp配合)

  cat source | ssh user @ hostcat>> / path / to / target


I have a legacy script which I am not able to understand.

The script is to transfer 4 files (2 ebcdic format files and 2 pdf files) in unix to mainframes through ftp.

ebcdic format file 1 is abc.xyz
ebcdic format file 2 is pqr.xyz
pdf file 1 is abc.pdf
pdf file 2 is pqr.pdf
mainframe file name is AM2P.BJCUN.SALCHG

The syntax of the command in the script is as below:

quote site recfm=fb
put /myfiles/abc.xyz AM2P.BJCUN.SALCHG
append /myfiles/abc.pdf AM2P.BJCUN.SALCHG
append /myfiles/pqr.xyz AM2P.BJCUN.SALCHG
append /myfiles/pqr.pdf AM2P.BJCUN.SALCHG

I want to achieve the same thing through SCP.

Could someone please tell what is the equivalent of put and append command of ftp in scp ??

解决方案

Put is just the normal scp

scp /path/to/source user@host:/path/to/target

Append only works with a little hack (and not with scp directly)

cat source | ssh user@host "cat >> /path/to/target"

这篇关于等同于ftp put和append in scp的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆