[HELP] Syntax Error in wordhash script
Posted: Tue Dec 13, 2016 12:16 am
Hi, I don't know if this is the right section, anyway you can move it.
I write this script that hash a single word in some hashes, but I see some syntax errors. I don't know why. This is the source code:
Can you help me to understand the error.
I want to delete the last two letters in the hashes too, and the "cut" command can't help me.
I write this script that hash a single word in some hashes, but I see some syntax errors. I don't know why. This is the source code:
Code: Select all
#!/bin/bash
## wordhasher 0.1
## davenull - [email protected]
## http://www.davenull.altervista.org
## Data Creazione: 12 Dicembre 2016
## Questo script trasforma una parola in svariati hash senza
## effettuarne il salt, cosa che normalmente avviene in CMS
## come Wordpress. Basta lanciare il programma seguito dalla
## parola da hashare.
echo "wordhasher 0.1"
echo "davenull - [email protected]"
echo "http://www.davenull.altervista.org
parola=$1
md5hash=$2
shahash=$3
sha1hash=$4
sha224hash=$5
sha256hash=$6
sha384hash=$7
sha512hash=$8
echo "Gli hash generati della parola" $parola "sono:"
md5hash="$(echo -n $parola | md5sum)"
echo "md5:" $md5hash
shahash="$(echo -n $parola | shasum)"
echo "sha:" $shahash
sha1hash="$(echo -n $parola | sha1sum)"
echo "sha1:" $sha1hash
sha224hash="$(echo -n $parola | sha224sum)"
echo "sha224:" $sha224hash
sha256hash="$(echo -n $parola | sha256sum)"
echo "sha256:" $sha256hash
sha384hash="$(echo -n $parola | sha384sum)"
echo "sha384:" $sha384hash
sha512hash="$(echo -n $parola | sha512sum)"
echo "sha512:" $sha512hash
I want to delete the last two letters in the hashes too, and the "cut" command can't help me.