how to pass passcode to a command?





Hi group,

I'm writing a bash script and part of the code is connection between to
machine so I need to have password to pass to the command.

Now, how can I redirect the password question? is it possible to
redirect it to /dev/null and somehow write a code to ask for password
in a managed way and pass it to the command. Let's say the command is
scp.

scp localmachine root@remotemachine:/tmp

or maybe it won't be safe?!! any suggestions?

thanks,
amit

.



Relevant Pages

  • Re: Redirecting lpt1 output to an installed printer
    ... to the lpt1 port. ... I am doing now is to redirect the output using the "net use" ... If there's a recognized printer on that port, ... which I do via a "net use LPT1" command inside a batch file. ...
    (microsoft.public.vb.general.discussion)
  • Re: How to capture "legacy" program output in MSH and redirect them to MshHostUserInterface
    ... command is redirected in the script or not. ... to see if the output of the script command is the default output pipe. ... The workaround is to always explicitly redirect native ... RedirectAlways flag on the runspace that will cause legacy applications to ...
    (microsoft.public.windows.server.scripting)
  • Re: net use script issue with terminal server and DFS
    ... redirect stdout into NUL ... command will be redirected to NUL, ... But it should give you an error message when you execute the same ...
    (microsoft.public.windows.terminal_services)
  • Re: Dos quit printing yesterday
    ... redirect via the net use command without sucess. ... >With the spooler job window open, ... when attermpting to print from a "command prompt" window. ...
    (microsoft.public.windowsxp.print_fax)
  • Re: How to speed this up?
    ... - Redirect the output from the "dir" command into a file ... redirection of a ls or dir command to a file. ... The thing is that dir gives some disk info.. ... The key is that you must play with it to ...
    (microsoft.public.scripting.vbscript)