-->
Adventures & experiences in contemporary technology
My usual way for sending the output of one command to another is to be place one command after another, separated by the pipe (|
) operator and adjusting the second command as needed. However, I recently found that this approach does not work well for docker pull
commands and I then uncovered another option.
That is to enclose the input command in $( )
within the output command. Within the parentheses, any kind of command can be declared and includes anything with piping as part of it. As long as text is being printed to the terminal, it can be fed to the second command and used as required. Thus, you can have something like the following:
docker pull $([command outputting name of image to download])
This approach has helped with other kinds of automation of docker image and container use and deployment because it is so general. There may be other uses found for the approach yet.