Hi, Sorry for the little bit off-topic. I have a script that has to performe a hash over a password. Problem is that sha512sum expects CTRL-D to be pressed to return to the command prompt. I've searched all over Google, but either I didn't do the right search or there is nothing relevant about this. Bottom line is that I need this command to print the password hash and returns to the shell automatically: $ sha512sum | xargs echo "password" | cut -f2 -d' ' Any help would be appreciated. Warm Regards, M?rio Gamito -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.centos.org/pipermail/centos/attachments/20080311/03c3d52e/attachment-0002.html>
On Tue, Mar 11, 2008 at 10:35 AM, M?rio Gamito <gamito at gmail.com> wrote: [...]> $ sha512sum | xargs echo "password" | cut -f2 -d' 'read x;echo "$x" | sha512sum | xargs echo "password" | cut -f2 -d' ' -- Marcelo "?No ser? acaso que ?sta vida moderna est? teniendo m?s de moderna que de vida?" (Mafalda)
On Tue, Mar 11, 2008 at 12:35:19PM +0000, M?rio Gamito alleged:> Hi, > > Sorry for the little bit off-topic. > > I have a script that has to performe a hash over a password. > Problem is that sha512sum expects CTRL-D to be pressed to return to the > command prompt. > > I've searched all over Google, but either I didn't do the right search or > there is nothing relevant about this. > > Bottom line is that I need this command to print the password hash and > returns to the shell automatically: > > $ sha512sum | xargs echo "password" | cut -f2 -d' ' > > Any help would be appreciated.Do you mean this? echo "password" | sha512sum -- Garrick Staples, GNU/Linux HPCC SysAdmin University of Southern California Please avoid sending me Word or PowerPoint attachments. See http://www.gnu.org/philosophy/no-word-attachments.html -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: not available URL: <http://lists.centos.org/pipermail/centos/attachments/20080311/9df3e67a/attachment-0002.sig>
On Tue, 2008-03-11 at 09:01 -0700, Garrick Staples wrote:> On Tue, Mar 11, 2008 at 12:35:19PM +0000, M?rio Gamito alleged: > > Hi, > > > > Sorry for the little bit off-topic. > > > > I have a script that has to performe a hash over a password. > > Problem is that sha512sum expects CTRL-D to be pressed to return to the > > command prompt. > > > > I've searched all over Google, but either I didn't do the right search or > > there is nothing relevant about this. > > > > Bottom line is that I need this command to print the password hash and > > returns to the shell automatically: > > > > $ sha512sum | xargs echo "password" | cut -f2 -d' ' > > > > Any help would be appreciated. > > Do you mean this? > echo "password" | sha512sumYou might try stdio re-direction: passwd=<your_password> passwd <<EOF $passwd EOF unset passwd> <snip sig stuff>HTH -- Bill