I would like to convert a list containing bunch of svn URLs of issues:
cat list.txt
//svn.server.address/repos/project/module1/branches/issue-001-name1
//svn.server.address/repos/project/module2/branches/issue-002-name2
//svn.server.address/repos/project/module3/branches/issue-003-name3
...
into newlist.txt that plus svn command and folder names to checkout them, like this:
svn co //svn.server.address/repos/project/module1/branches/issue-001-name1 issue-001-module1
svn co //svn.server.address/repos/project/module2/branches/issue-002-name2 issue-002-module2
svn co //svn.server.address/repos/project/module3/branches/issue-003-name3 issue-003-module3
...
I have tried something like:
eval $(awk -F'/branches/' '{print $2}' list.txt|awk -F'-' '{print "i="$1"-"$2}')
eval $(awk -F'/branches/' '{print $1}' list.txt|awk -F'/' '{print "j="$NF}')
name=$i"-"$j
awk '{print "svn co "$1" "n}' n=$name list.txt >newlist.txt
But it would always get the last variable, I'm totally newbie for this so any help would be greatly appreciated!
