I'm trying to execute several commands in a subshell, e.g. (cd ~ && pwd)
in bash. I can do home >>= cd
in the current shell to combine some operations, but I can't figure out how I can do the same in a subshell.
I went through the documentation and couldn't find something that looked promising, however, I was able to do it in this way inshell "cd ~ && pwd" mempty
.
Even though this works, it does not compose as nicely and when needing to execute a bunch of commands it gets ugly.
Does anyone know how to achieve the composition of several operations in a subshell with the same style as done in the current shell?