How to use xargs to remove whitespaces (Dub executable path)
andre at s-e-a-p.de
Wed Sep 4 11:38:37 UTC 2019
On Wednesday, 4 September 2019 at 10:34:28 UTC, Sebastiaan Koppe
> On Wednesday, 4 September 2019 at 05:52:12 UTC, Andre Pany
>> I try to get the executable path from a dub package using this
>> dub describe dscanner --data=target-path,target-name
>> --data-list | xargs
>> But the output always contains a space between target-path and
>> /home/user/.dub/packages/dscanner-0.8.0/dscanner/bin/ dscanner
>> How can I get the full path without a space on a debian system
>> in a 1 liner?
>> Kind regards
> What about this?
> dub describe scanner --data=target-path,target-name --data-list
> --data-0 | tr -d '\0'
> or if you have jq installed:
> dub describe dscanner | jq '.targets.buildSettings |
Thanks to all! Yes replacing spaces with NUL really makes sense.
More information about the Digitalmars-d-learn