我正在尝试从文件中删除文件的前n行,我计算n并将该值赋给myvariable
command = "tail -n +"myvariable" test.txt >> testmod.txt"
call(command)
Run Code Online (Sandbox Code Playgroud)
我从子进程导入了调用.但我在myvariable上遇到语法错误.
我正在尝试从创建的公钥中获取指纹,如下所示:
openssl genrsa -out test.pem -aes128 -passout pass:testphrase 2048
openssl rsa -pubout -in test.pem -out test_public.pem -passin pass:testphrase
Run Code Online (Sandbox Code Playgroud)
我正在将公钥上传到我的云提供商,该云提供商确认了指纹70:d6:cb:9c:c7:95:ad:6f:49:84:4f:d1:fb:71:a8:53,并且我可以使用此命令从私钥获取指纹
openssl rsa -in test.pem -pubout -outform DER | openssl md5 -c
(stdin)= 70:d6:cb:9c:c7:95:ad:6f:49:84:4f:d1:fb:71:a8:53
Run Code Online (Sandbox Code Playgroud)
我试过了
openssl rsa -pubin test_public.pem -pubout -outform DER | openssl md5 -c
Run Code Online (Sandbox Code Playgroud)
但这给了我d4:1d:8c:d9:8f:00:b2:04:e9:80:09:98:ec:f8:42:7e。我想直接从公钥获取指纹,我觉得我在这里错过了一些简单的东西。
我正在尝试使用std :: max_element找到向量的最大值.当我运行程序时,我得到一个分段错误,我认为这与std :: end越过向量的末尾有关吗?我已经尝试将其更改为std :: end(tempdata)-1)但无济于事.
auto max = std::max_element(std::begin(tempdata), std::end(tempdata));
std::ofstream maxcurrent("maxcurrent.txt", std::ios::app);
maxcurrent << v << std::setw(15) << *max << std::endl;
Run Code Online (Sandbox Code Playgroud)
看了这个答案,我不明白为什么我的工作不起作用.