急!简单问题,帮忙看下

绿旅嗒 2016-05-04 10:46:12
要执行的脚本:
#! /bin/bash
gpg --recipient 025674861 --output test1.txt.gpg --encrypt test1.txt
if [ -f "test1.txt.gpg" ]; then
echo "test1.txt.gpg"
fi

执行后:
[user@webss shell]$ ./gpgEncryptFil
gpg: 51538612BA: There is no assurance this key belongs to the named user

pub 5168G/51538612BA 2016-04-21 XXX
Primary key fingerprint: XXXXX
Subkey fingerprint: XXXX

It is NOT certain that the key belongs to the person named
in the user ID. If you *really* know what you are doing,
you may answer the next question with yes.

Use this key anyway? (y/N)

怎样让脚本自动选择“y”,不用手动选。我需要java调用。
因需要选择,java调用脚本,不能正常执行。




...全文
213 1 打赏 收藏 转发到动态 举报
写回复
用AI写文章
1 条回复
切换为时间正序
请发表友善的回复…
发表回复
绿旅嗒 2016-05-04
  • 打赏
  • 举报
回复
CSDN不行了,发帖没人回! 自己解决了。GPG公钥需要设置信任 作者:陈俊儒 链接:https://www.zhihu.com/question/19987578/answer/13586551 来源:知乎 著作权归作者所有。商业转载请联系作者获得授权,非商业转载请注明出处。 只要将证书设置为可信就好了, --no-tty 是参数是不在控制台输出数据,去掉的话也能看到问题 ~~ gpg 需设置key为可信,不然每次都会提示"Use this key anyway? (y/N)" 命令: gpg --edit-key Todaynic 然后参照: When importing a public key onto another machine, you may have configure gpg to trust the key. Otherwise, when you use the key to do encryption, you may see a prompt like this: It is NOT certain that the key belongs to the person named in the user ID. If you *really* know what you are doing, you may answer the next question with yes. Use this key anyway? (y/N) To trust the key, run: gpg --edit-key NAME gpg will output some information, and show a line like: trust: undefined validity: unknown You will be at a console, and you have to type "trust": Command> trust Please decide how far you trust this user to correctly verify other users' keys (by looking at passports, checking fingerprints from different sources, etc.) 1 = I don't know or won't say 2 = I do NOT trust 3 = I trust marginally 4 = I trust fully 5 = I trust ultimately m = back to the main menu Your decision? 5 Do you really want to set this key to ultimate trust? (y/N) y Type "quit" to quit. If you run gpg --edit-key NAME again, you will see a line as below, which means the key is now trusted. trust: ultimate validity: ultimate
内容概要:本文围绕“面向高精度电流控制的PMSM多参数PSO辨识模型研究”,系统阐述了基于Simulink的永磁同步电机(PMSM)多参数辨识方法,重点采用粒子群优化算法(PSO)实现对电机关键内部参数的高精度辨识。研究构建了完整的PMSM控制系统仿真模型,结合智能优化算法,解决了传统参数辨识中精度低、收敛慢的问题,有效提升了电流环控制的动态性能与稳态精度。该方法特别适用于对控制精度和响应速度要求较高的工业应用场景,如高性能伺服系统、电动汽车驱动系统等,具有较强的工程实用价值和科研参考意义。文中提供了完整的Simulink仿真模型与配套代码,确保了研究内容的可复现性和实践操作性。; 适合人群:具备电机控制、自动化或电气工程等相关专业背景,熟悉MATLAB/Simulink仿真环境,从事电机驱动系统研发、控制算法设计或相关领域科研工作的工程师及研究生,尤其适合工作1-5年、希望深入理解先进参数辨识技术的研发人员。; 使用场景及目标:①开展高精度PMSM控制系统的设计与参数辨识研究;②学习并掌握PSO等智能优化算法在电机系统参数辨识中的具体实现与调优技巧;③完成学术论文复现、科研项目验证、毕业设计或工程原型开发,提升对现代电机控制核心技术的理解与应用能力。; 阅读建议:建议读者结合提供的Simulink模型与源代码进行动手实践,按照文档逻辑逐步搭建与调试仿真系统,重点关注PSO算法与电机模型的交互机制、目标函数设计及参数收敛过程,通过对比不同工况下的辨识结果,深入理解算法性能与控制精度之间的内在联系。

18,828

社区成员

发帖
与我相关
我的任务
社区描述
Linux/Unix社区 专题技术讨论区
社区管理员
  • 专题技术讨论区社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧