Wallet output alignment
gen_report_header() {
# Check if the header already exists in the report file (look for a line starting with "DB_NAME")
if ! grep -q "^DB_NAME" "$REPORT_FILE"; then
# Print a formatted header line with fixed-width columns.
# %-8s : DB_NAME (8 characters, left aligned)
# %-10s : Version (10 characters)
# %-12s : WRL_STATUS (12 characters)
# %-10s : WL_TYPE (10 characters)
# %-8s : WRL_PRE (8 characters)
# %-8s : TBS (8 characters)
# %-10s : WL_BKUP (10 characters)
# %-8s : CLK_PWD (8 characters)
# %-10s : PWD_MATCH (10 characters)
# %-20s : WRL_PATH (20 characters)
# %-8s : RUN_DT (8 characters) — you can adjust the order if desired
printf "%-8s | %-10s | %-12s | %-10s | %-8s | %-8s | %-10s | %-8s | %-10s | %-20s | %-20s\n" \
"DB_NAME" "Version" "WRL_STATUS" "WL_TYPE" "WRL_PRE" "TBS" "WL_BKUP" "CLK_PWD" "PWD_MATCH" "RUN_DT" "WRL_PATH" >> "$REPORT_FILE"
fi
}
****
RUN_DT=$(date '+%Y-%m-%d %H:%M:%S')
printf "%-8s | %-10s | %-12s | %-10s | %-8s | %-8s | %-10s | %-8s | %-10s | %-20s | %-20s\n" \
"$DBNAME" "$DB_VERSION" "$WALLET_STATUS" "$WALLET_TYPE" "$WRL_PRESENT" "$TBS_ENCR" "$WRL_BKUP" "$CLK_PWD" "$PWD_MATCH" "$RUN_DT" "$WALLET_LOCATION" >> "$REPORT_FILE"
Comments
Post a Comment