我正在尝试使用批处理脚本从sftp站点下载文件.我收到以下错误:
Permission denied (publickey,password,keyboard-interactive).
Couldn't read packet: Connection reset by peer
Run Code Online (Sandbox Code Playgroud)
运行命令时:
sftp -b /home/batchfile.sftp <user>@<server ip>:<folder>
Run Code Online (Sandbox Code Playgroud)
在batchfile.sftp
包括这些数据:
password
lcd [local folder]
cd [sftp server folder]
get *
bye
Run Code Online (Sandbox Code Playgroud)
注意:在提示符下运行时它正在工作
sftp <user>@<server ip>:<folder>
Run Code Online (Sandbox Code Playgroud)
但我需要能够自动输入密码.
我正在尝试编译这个C++代码:
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include "general_configuration.h"
#include "helper_functions.h"
#define LINE_LEN 80
// file_with_as_ext returns 1 if the input has .as extension
int file_with_as_ext(char* input)
{
char* dot_value = strchr(input, '.');
if (dot_value == NULL)
return 0;
else
{
if (strcmp(dot_value,".as") == 0)
return 1;
}
}
Run Code Online (Sandbox Code Playgroud)
但是我得到了错误"C2144: syntax error : 'int' should be preceded by ';'"
我无法理解为什么,#define不需要';' 在末尾.
任何想法?
在第一次迭代 - 我想从0..10创建一个随机数
这就是我实施它的方式 -
int generator= (int)(Math.random() * (10));
Run Code Online (Sandbox Code Playgroud)
在第一次迭代中,我想创建另一个随机数,但没有其中一个值.例如,我想要没有数字4的随机数.只有1,2,3,5,6,7,8,9,0
当生成随机数时,如何从数字0..10中删除其中一个值?