Operating System - HP-UX
1833552 Members
3715 Online
110061 Solutions
New Discussion

Re: Crypt not prompting for password

 
Anand_30
Regular Advisor

Crypt not prompting for password

I am trying to unencrypt some crypted data files in a shell script using the crypt command. But when I execute the script it is not waiting for the Enter key input. It is skipping the enter key input.

Can anyone please help me out in this problem.

Thanks,
Andy
2 REPLIES 2
A. Clay Stephenson
Acclaimed Contributor

Re: Crypt not prompting for password

Normally crypt is supplied with the key as a command-line argument and then stdin is read as the file to be encrypted/decrypted. Only when an argument is not supplied is the controlling terminal queried. I suspect that for some reason the process can't find the controlling terminal or can't set echo to off. You should prompt your user for the key using a read statement (possibly doing a stty -echo first) then supply that key as an argument.
If it ain't broke, I can fix that.
Elmar P. Kolkman
Honored Contributor

Re: Crypt not prompting for password

Perhaps you accidentially gave the file as argument?
Every problem has at least one solution. Only some solutions are harder to find.