psyinfra / onyo

text-based inventory system on top of git
ISC License
3 stars 5 forks source link

`xargs` usage in demo script does not work on macOS #591

Closed TobiasKadelka closed 6 months ago

TobiasKadelka commented 6 months ago
❱ onyo get --match type=laptop -H --keys path | xargs -d "\n" onyo -y set --keys USB_A=2 --path

xargs: invalid option -- d
usage: xargs [-0opt] [-E eofstr] [-I replstr [-R replacements] [-S replsize]]
             [-J replstr] [-L number] [-n number [-x]] [-P maxprocs]
             [-s size] [utility [argument ...]]
Exception ignored in: <_io.TextIOWrapper name='<stdout>' mode='w' encoding='utf-8'>
BrokenPipeError: [Errno 32] Broken pipe
TobiasKadelka commented 6 months ago

Notes:

  1. Currently working on both systems would be: onyo set --keys USB_A=2 --path $(onyo get --match type=laptop -H --keys path)
  2. In the future this solution will also work (a.k.a. like above, but without xargs) onyo get --match type=laptop -H --keys path | onyo set --keys USB_A=2

Once functioning and tested both variants should be described under https://onyo.readthedocs.io/en/latest/

aqw commented 6 months ago

The fix was merged in #602

Closing. :-)

TobiasKadelka commented 6 months ago

My plan was to first verify if it now actually does work on macOS or something else would happen :P And yes, works just like intended.