开发者

shell script (running via cron) to enter password when prompted

I have a daily cron tas开发者_StackOverflow社区k which automatically unrars a rar file and processes it's contents, however, the contents are now password protected so i'm wondering if there's a reliable way to echo the password when prompted? The password prompt comes from the UNRAR program i've installed, running on CentOS. Thanks for any help!


If you're using unrar for unpacking, you can define the password as command line parameter:

unrar x -ppassword package.rar

Note that there's no space between -p and your password parameter.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜