Unix Pipes in commands to set Environment variables

Hi all -

I need to set an environment variable using a set of commands. Basically “command | other_command”, but it’s rejecting this with the pipe.

I’ve run it like $(command | other_command). I’ve run with back ticks. I’ve run it straigt like command | other_command. I’ve tried escaping the pipe like command \| other_command. No luck.

What’s the proper way to do this?

1 Like