File: comment_15_cd191275a277aee5de80507d5b5da69b._comment

package info (click to toggle)
git-annex 8.20210223-2
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 68,764 kB
  • sloc: haskell: 70,359; javascript: 9,103; sh: 1,304; makefile: 212; perl: 136; ansic: 44
file content (17 lines) | stat: -rw-r--r-- 708 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
[[!comment format=mdwn
 username="chris@a3ac8acdfdc53fa269c7b9bda4306c25b92d6624"
 nickname="chris"
 avatar="http://cdn.libravatar.org/avatar/eb7f91e7b7b3457ca57701a40f920f2a"
 subject="Files with spaces"
 date="2019-02-19T14:04:04Z"
 content="""
For anyone dealing with files with spaces, try this:

```
git annex find --include '*' --format='${escaped_file} ${escaped_key}\n' | \
    sort -k2 | uniq --all-repeated=separate -f1 | \
    sed 's/ [^ ]*$//'
```

Using `escaped_file` escapes the filename, which will avoid whitespace so the rest of the pipe commands work correctly. You'll need to deal with the files being escaped in the final output, but you'll see them correctly. This worked for me.
"""]]