zeek/auxil/btest/testing/Scripts/convert-path-list.sh
Patrick Kelley 8fd444092b initial
2025-05-07 15:35:15 -04:00

17 lines
361 B
Bash

#!/usr/bin/env bash
# This script is used by tests.environment-windows to convert a semi-colon
# separated list of Windows-style paths into a colon-separate list of
# POSIX-style paths.
new_list=""
IFS=';' read -ra PARTS <<<"$1"
for i in "${PARTS[@]}"; do
p=$(cygpath "${i}" | sed 's/\/$//')
new_list+=$p
new_list+=":"
done
echo "${new_list%?}"