#!/bin/bashbashtrap(){# filtering the output an write it to file when the script is closed by CTRL+Cvar=$(grep -o "[0-9]\{5,\}" file.txt) echo $var > file.txt}

# when the script i killed or ended I want to make its output be written to a file.if kill -0 $$; then cd ~/hashcat-0.47/ # this script is ivoked with paramaters and its output is redirected to be written to a file called file.txt ./hashcat-cli32.bin -m 400 -a 3 --pw-min=12 --pw-max=12 -o rockyou.txt --remove hashfile.all -s 9087560 ?l?u?d?l?u?d?l?u?d?l?u?d?l?u?d?l?u?d?l?u?d?l?u?d?l?u?d?l?u?d?l?u?d?l?u?d > file.txt 2>&1fi

OK so what I want is sth like this:1. Make this script constantly running when my system is started 2. When my system is closed or reboot I want save the output to a file. Actually it happens only when script is terminate by CTRL+C combination

Who is online

Users browsing this forum: No registered users and 1 guest

You cannot post new topics in this forumYou cannot reply to topics in this forumYou cannot edit your posts in this forumYou cannot delete your posts in this forumYou cannot post attachments in this forum