1

I am trying to download only some files with the name "battery", using svn export:

svn export https://github.com/zayronxio/Mojave-CT/trunk/panel/24 | awk "battery"
svn export https://github.com/zayronxio/Mojave-CT/trunk/panel/24 | find . -iname "battery"
svn export https://github.com/zayronxio/Mojave-CT/trunk/panel/24 | grep -l "battery"

But these commands download all unnecessary files.

1

You can list files on remote repository with ls (check svn help ls) and can it filter with grep.

I filter with sed because make some modification (insert the repository URL before the file name). With xargs pass the file list to svn export.

svn ls "https://github.com/zayronxio/Mojave-CT/trunk/panel/24" | \
  sed -n '/battery/ s,^,https://github.com/zayronxio/Mojave-CT/trunk/panel/24/,p' | \
  xargs -L1 svn export

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.