【问题标题】:How to feed the actual value on the command where a text file is expected如何在需要文本文件的命令上提供实际值
【发布时间】:2015-08-19 01:39:16
【问题描述】:

在我的 Linux 环境中,我使用的是这种格式的已安装命令。

command1 -u <username> -p <password-file> ... 

在这个密码文件中,它保存了一个文本格式的密码值,例如“abc”。

在运行这个命令的时候,感觉每次都创建一个文件来保存这个密码值很不方便!那么有没有办法可以直接在这个命令行上输入这个“abc”值???

谢谢, 春

【问题讨论】:

  • 更新。该命令是这种格式。 “command1 -u 用户名 -p 密码文件...”

标签: unix command


【解决方案1】:

如果您使用的是 bash(并且如果您在 Linux 中运行,那么您很有可能是或可以这样做):

command -u username -p <(echo abc)

相当于传递了一个内容为“abc\n”的文件名。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2022-01-06
    • 2020-07-26
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多