0

i have a command that ask for a password as parameter. The documentation of the command allow a infile redirection as "parameter" argument (taking the file content as value). It works but if i add a STDOUT redirection, the infile is ignored as input

# command here after is a generic name for any executable, not the word command
# work
command -p <pwd.file

# failed
command -p <pwd.file >out.file

i try with exec pre redirection, group of command or subshell with parenthesis, nothing work.

 exec 1>out.file
 command -p <pwd.file

the out.file show:

Password?

A password is required. Enter a password value.

Password?

A password is required. Enter a password value.

until i cancel the execution

i see this thread How to redirect ... but without infile

NeronLeVelu
  • 9,908
  • 1
  • 23
  • 43
  • 1
    Revised: It seems that your `command` is echoing it's prompt to stdout. I think most programs would prompt to stderr for password input, but I'm not an expert on that. So, this seems to be a `command` specific problem. (Note if you do `man command` you'll get `bash's shell builtins` page, of which `command` is one of 30-40 builtin commands, which has a different usage). I would spend my time trying to confirm that your `command` is writing it's prompt to stdout AND/OR consider filing a bug report with your `command`s authors. – shellter Jun 20 '23 at 17:22
  • command is a generic name here, not the word command because it represent several application in this case like `tacmd` from IBM in one of the case. – NeronLeVelu Jun 21 '23 at 08:28

0 Answers0