I need to execute the following command in WSL:
sudo curl -L "https://github.com/docker/compose/releases/download/1.23.2/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
In order to execute it from powershell, i tried to run:
Ubuntu1804 run "sudo curl -L 'https://github.com/docker/compose/releases/download/1.23.2/docker-compose-$(uname -s)-$(uname -m)' -o /usr/local/bin/docker-compose"
But errors occur as it cannot find the value of uname -s
and uname -m
uname : The term 'uname' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling
of the name, or if a path was included, verify that the path is correct and try again.
At line:1 char:107
+ ... ocker/compose/releases/download/1.23.2/docker-compose-$(uname -s)-$(u ...
+ ~~~~~
+ CategoryInfo : ObjectNotFound: (uname:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
But the following command works as i manually entered the value of uname -s
and uname -m
in that command.
Ubuntu1804 run "sudo curl -L 'https://github.com/docker/compose/releases/download/1.23.2/docker-compose-Linux-x86_64' -o /usr/local/bin/docker-compose"
Can anyone please help me to find when using powershell, how to incorporate the results of some commands to another command and execute it in WSL?
Also, how can i incorporate the value of environment variables like $USER
in WSL commands and execute from powershell?