1

I have a list of directory names in a text file. I want to use these as part of a file_name a git-svn clone command.

This prints out the contents of the file line by line.

cat repos_to_migrate.txt | tee $1

This however does not work:

cat repos_to_migrate.txt | git svn clone file:///home/svn/$1
... Unable to open repository 'file:///home/svn' ...

Any ideas here? I'f it matters I'm running centos5.

1 Answer 1

1
(
    while read repo; do
        git svn clone file:///home/svn/$repo
    done
) < repos_to_migrate.txt
Sign up to request clarification or add additional context in comments.

4 Comments

Thank you. This is working great so far. If a command failed the script would continue correct?
If you mean if one of the git svn clone operations would fail, then yes, it would continue with the next one.
If you want to abort instead of continue on failure, just add set -e on a line before the while.
Or use git svn clone ... || exit.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.