Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有一个由应用程序生成的文本文件。在应用程序中使用 shell 脚本,我想使用 'vim' 为文本文件设置密码(密码由应用程序根据用户登录的帐户设置)。我曾尝试使用“-c”和“-S”选项,但 shell 脚本仍会手动提示输入密码。
主要目标是以编程方式为文本文件设置密码,并且经过身份验证的用户可以使用 vim 查看文件。