News for hackers. Stuff that matters.
Re:Restic – Backups Done Right by OJFord on Saturday November 13, 2021 @09:02PM (#29214867)
I've never seen/used xargs (/export) like:

    export $(sudo cat <protected_credentials_file> | xargs)

Is that the same as sudo cat f | xargs export?

If so, I think an important difference is that mine won't hide the exit code, and you can then answer a sibling commenter (on forgetting without checking) with 'I omitted set -e at the top'.

Re:Restic – Backups Done Right by jedbrown on Saturday November 13, 2021 @11:04PM (#29215280)
export is a shell builtin -- it can't be executed by xargs and even if it could, wouldn't be in the context of the shell you want.
Re:Restic – Backups Done Right by OJFord on Tuesday November 16, 2021 @04:58AM (#29238789)
True. `sh -c export` then, with `set -o allexport` ;)
Re:Restic – Backups Done Right by gizdan on Sunday November 14, 2021 @04:56AM (#29216310)
The sibling comment said.

It looks like in this example it's used simply to trim whitespace. E.g.

    $ echo '  hello  ' | xargs
    hello