OP 29 December, 2024 - 04:42 PM
This post is by a banned member (bballer304) - Unhide
09 January, 2025 - 12:55 AM
(29 December, 2024 - 04:42 PM)LateNightVibe Wrote: Show More #!/bin/bash echo "HK's Ultimate Text Editor" echo "Select a module:" echo "1. Capitalise passwords" echo "2. Clean passwords" echo "3. Put symbol between letters and numbers" echo "4. Basic - Advanced edits" echo "5. Extract Microsoft Lines" echo "6. Lowercase passwords" echo "7. Uppercase passwords" read -p "Enter your choice (1-7): " choice case $choice in 1) echo "You selected: Capitalise passwords" input_file="input.txt" output_file="output.txt" awk -F ":" '{split($2, a, ""); a[1]=toupper(a[1]); $2=""; for(i=1;i<=length(a);i++) $2 = $2 a[i]; print}' OFS=":" "$input_file" > "$output_file" echo "First letter of passwords capitalized successfully. Output written to $output_file" ;; 2) echo "You selected: Clean passwords" input_file="input.txt" output_file="output.txt" awk -F':' ' { if(length($2) >= 9 && !($2 ~ /^[0-9]+$/)){ print $0 } } ' "$input_file" > "$output_file" echo "Passwords cleaned successfully. Output written to $output_file" ;; 3) echo "You selected: Put symbol between letters and numbers" read -p "Enter the filename to process: " FILE read -p "Enter the symbol to insert between letters and numbers: " SYMBOL if [ ! -f "$FILE" ]; then echo "File does not exist." exit 1 fi sed -E -n "s/([a-zA-Z])([0-9])/\1$SYMBOL\2/gp; s/([0-9])([a-zA-Z])/\1$SYMBOL\2/gp" "$FILE" > edited_"$FILE" if [ -s edited_"$FILE" ]; then echo "Processing complete. Edited file is saved as edited_$FILE" else echo "No changes were made to the original file." rm edited_"$FILE" fi ;; 4) echo "You selected: Basic - Advanced edits" FILE="hk.txt" sed -E 's/^(.*):([~`!@#$%^&*_=+,.<>?-])?(.*)([~`!@#$%^()&*_=+,.<>?-])(.*)?$/\1:\3\5/' "$FILE" > remove_prefix_done.txt symbols=('!' '$' '*' '@' '#' '!!' '@@' '$$' '##' '!!!' '@@@' '**' '?' '.' '%' '&' '1') for sym in "${symbols[@]}"; do sed -E "s/^(.*):(.*)$/\1:\2$sym/" "$FILE" >> basic_edit.txt done awk 'NR==FNR{a[$0];next} !($0 in a)' "$FILE" basic_edit.txt > basic_edit_done.txt rm basic_edit.txt cat remove_prefix_done.txt basic_edit_done.txt > goodshit.txt rm remove_prefix_done.txt basic_edit_done.txt echo "Basic - Advanced edits completed. Output written to goodshit.txt" ;; 5) echo "You selected: Extract Microsoft Lines" input_file="input.txt" output_file="microsoft.txt" [ -f "$output_file" ] && rm "$output_file" grep -E "@Outlook.com|@hotmail.com|@msn.com|@windowslive.com|@Live.com|@Live.ca|@Live.co.uk|@Live.fr|@hotmail.co.uk|@Outlook.co.uk|@Live.nl" "$input_file" >> "$output_file" echo "Microsoft lines extracted successfully. Output written to $output_file" ;; 6) echo "You selected: Lowercase passwords" input_file="input.txt" output_file="lowercase_output.txt" if [ ! -f "$input_file" ]; then echo "Error: $input_file does not exist." exit 1 fi awk -F ":" 'NF==2 {print $1":" tolower($2)}' OFS=":" "$input_file" > "$output_file" if [ -s "$output_file" ]; then echo "All passwords lowercased successfully. Output written to $output_file" else echo "No valid lines found to process. Output file is empty." rm "$output_file" fi ;; 7) echo "You selected: Uppercase passwords" input_file="input.txt" output_file="uppercase_output.txt" if [ ! -f "$input_file" ]; then echo "Error: $input_file does not exist." exit 1 fi awk -F ":" 'NF==2 {print $1":" toupper($2)}' OFS=":" "$input_file" > "$output_file" if [ -s "$output_file" ]; then echo "All passwords uppercased successfully. Output written to $output_file" else echo "No valid lines found to process. Output file is empty." rm "$output_file" fi ;; *) echo "Invalid choice. Exiting." ;; esac |
Create an account or sign in to comment | ||
You need to be a member in order to leave a comment | ||
Create an account
Sign up for a new account in our community. It's easy!
|
or |
Sign in
Already have an account? Sign in here.
|
Users browsing this thread: 2 Guest(s)