Skip to content

Instantly share code, notes, and snippets.

@guodonn01
guodonn01 / gist:017674690f83ee5265bbfa0992b10c8f
Created November 1, 2025 03:15
fields extract and convert to csv/html/markdown
#!/bin/bash
# --- Bash Version Check ---
if [[ -z "${BASH_VERSINFO[0]}" || "${BASH_VERSINFO[0]}" -lt 4 ]]; then
echo "Error: This script requires Bash version 4.0 or higher." >&2
echo "You are running: $BASH_VERSION" >&2
exit 1
fi
# --- Default Variables ---
@guodonn01
guodonn01 / gist:22267ce907b1af15a8a731bffea6c6b5
Created October 31, 2025 13:42
another version of converter
#!/bin/bash
# Associative arrays (for keys with spaces) require Bash 4.0+
if [[ -z "${BASH_VERSINFO[0]}" || "${BASH_VERSINFO[0]}" -lt 4 ]]; then
echo "Error: This script requires Bash version 4.0 or higher." >&2
echo "You are running: $BASH_VERSION" >&2
exit 1
fi
input_file=""