简体   繁体   中英

How to feed the actual value on the command where a text file is expected

In my Linux environment, I am using a installed command that is of this format.

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

where in this password-file, it keeps a password value of the text format, such as "abc".

When running this command, I feel it is very inconvenient to every time create a file to hold this password value! So is there a way I can feed this "abc" value directly on this command line ???

Thanks, Chun

If you are using bash (and if you are running in Linux, chances are good you are, or can) you can do:

command -u username -p <(echo abc)

which is equivalent to passing the name of a file with contents "abc\\n".

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM