Add execute permission to file:
chmod +x ./convert-list-hash.sh
Run the script, passing the file path:
./convert-list-hash.sh lista.txt
After running the script, a new file called new-file.txt
will be created with the hash.
#!/bin/bash | |
# Author: Francisco Chaves <https://franciscochaves.com.br> | |
# Description: Convert text list to MD5 hash list | |
FILE=$1 | |
cat $FILE | xargs -i bash -c "echo -n {} | md5sum | cut -d ' ' -f1 | tee -a new-file.txt" |
123 | |
456 | |
789 |