I've a command that needs input from keyboard and cannot get it directly from command line, like sudo, and I've forgotten the syntax to pass a known variable to a 'terminal input: [sudo] password for cl-r:'
#/bin/bash (or ksh)
.....
VARIABLE_NEEDED=$1
mycommand_wait_and_needs_input_from_keyboard [?? magic-instruction_beginning ??] # command prompt for input
VARIABLE_NEEDED
[?? magic-instruction_end ??]
# ... command executed
[ $? != 0 ] && ...