note/temp_curl_results.txt
2025-11-19 10:16:05 +08:00

15 lines
372 B
Plaintext

cat tech/prompt/curl.md | while IFS= read -r url; do
if [ -z "$url" ]; then
continue
fi
http_status=$(curl -Is --max-time 5 "$url" 2>/dev/null | head -n 1 | awk '{print $2}')
if [[ "$http_status" =~ ^[23] ]]; then
echo "$url (可访问)" >> "$temp_file"
else
echo "$url (无法访问)" >> "$temp_file"
fi
done
mv "$temp_file" tech/prompt/curl.md