3 ms·
The author also has not realized that xargs -0 can transform null-delimited fields into space-delimited fields. I believe the invocation could be: export $(
by chasil 4y ago
The author also has not realized that xargs -0 can transform null-delimited fields into space-delimited fields.
I believe the invocation could be:
export $(xargs -0 echo < /proc/1/environ)
It could be dangerous to use echo in this way in some circumstances.
- theamk 4y agoeh, that sounds like a bad idea, as vars can contain spaces as well. You can solve this with quoting, but it is tricky, it is much nicer (and safer in case of errors!) to ensure you don't need to do that.
- chasil 4y agoSomehow, "$@" would have to be involved for safe processing. I will ponder it.
- teddyh 4y ago“echo” is the default action for xargs, so you don’t need to specify it.