Skip to content

Instantly share code, notes, and snippets.

@kbinani
kbinani / svn-export.sh
Last active December 18, 2021 01:03
A shell script to export svn repository without subversion client.
#!/bin/bash
function svn_export {
function svn_export_one { (
local url=$1
local directory=$2
local revision=$3
local prefix="$(echo $url | cut -b $(expr ${#base_url} + 2)-)"
for file in $(curl -L "$url?p=$revision" 2>/dev/null | grep '<li><a href=".*"' | sed 's:^.*<li><a href=".*">\(.*\)</a>.*$:\1:g'); do
if [ "$file" = "$(echo $file | sed 's:^.*\(/\)$:\1:g')" -a "$file" != ".." ]; then