如何解决使用选项使用SCP获取和发送文件 发送文件获取文件
如何用选项而不是单行写scp user@url:/tmp/foo ./
?
我尝试过,但是没有成功:
scp -l user url /tmp/foo ./
解决方法
发送文件
export const replaceLink = (
link: string,text: string,editorState: EditorState,setEditorState: (editorState: EditorState) => void
): void => {
const currentContent = editorState.getCurrentContent();
// Create new link entity
const contentStateWithEntity = currentContent.createEntity(
"LINK","MUTABLE",{ url: link,text }
);
// Get created link entity's key
const entityKey = contentStateWithEntity.getLastCreatedEntityKey();
let selection = editorState.getSelection();
const entityRange = getEntityRange(
editorState,getSelectionEntity(editorState)
);
const isBackward = selection.getIsBackward();
if (isBackward) {
selection = selection.merge({
anchorOffset: entityRange.end,focusOffset: entityRange.start
});
} else {
selection = selection.merge({
anchorOffset: entityRange.start,focusOffset: entityRange.end
});
}
const updatedEditorWithText = Modifier.replaceText(
currentContent,selection,text,editorState.getCurrentInlineStyle(),entityKey
);
const newEditorState = EditorState.push(
editorState,updatedEditorWithText,"insert-characters"
);
setEditorState(
EditorState.push(newEditorState,"insert-characters")
);
};
获取文件
scp -o user=myuser foo.txt myserver:/my/folder
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。