testsAndMisc/linux_configuration/scripts/single_use/utils/convert_words.sh
Krzysztof kuhy Rudnicki 42a66a1419 refactor(linux_configuration/scripts): split all scripts into single_use/ and periodic_background/
- Move all linux_configuration scripts into two semantic categories:
  - single_use/: scripts run once manually (fresh install, fixes, setup)
  - periodic_background/: scripts run by systemd timers or daemons
- Preserve existing subdirectory structure within each category
- Fix lib/common.sh source paths for new directory depths
- Fix CONFIG_DIR depth in setup_periodic_system.sh and check_and_enable_services.sh
- Update all references in tests, fresh-install/main.sh, nix modules, and docs
- Fix check_polling_antipatterns.sh false positives (||, regex |, case patterns, jq strings)
- Fix pre-existing mypy exclusion path and type annotations for moved tools/ directory
- Rewrite check_polling_antipatterns.sh using awk (no bash regex loops); add require_serial: true
2026-05-15 00:32:35 +02:00

26 lines
655 B
Bash
Executable File

#!/bin/bash
# Check if input and output files are provided
if [ $# -ne 2 ]; then
echo "Usage: $0 input_file.txt output_file.txt"
exit 1
fi
# Check if the input file exists
if [ ! -f "$1" ]; then
echo "Error: File '$1' not found"
exit 1
fi
# Store output file name
output_file="$2"
# Clear output file at the beginning
: > "$output_file"
# Process file: extract 5-8 char alphabetic words, uppercase, deduplicate
# grep -oE extracts words directly (replaces two tr passes), sort -u deduplicates
grep -oE '[a-zA-Z]{5,8}' < "$1" | tr '[:lower:]' '[:upper:]' | sort -u > "$output_file"
echo "Processing complete. Results saved to '$output_file'"