You are not logged in.
Hi,
I want to execute a command (in my case
curl wttr.in ) that would be displayed in st and would be launched as a shortcut.
So for example I press a shortcut which executes st with the command I mentioned and then leaves it in interactive mode. I have figured out how to launch st, but it closes immediately after finishing the command. How do I fix it?
Thanks.
Last edited by peonerovv (2021-12-19 09:04:11)
Offline
I don't see an equivalent of the "-hold" switch, so you'll have to stall the subprocess
st -e bash -c 'curl wttr.in/NY; read'Offline
That seems to work, although I'd also like to be able to interact with it after I get the output. Maybe if I somehow could add the command to .bashrc, launch st and put it back into the previous state?
Offline
st -e bash --rcfile <(cat ~/.bashrc; echo 'curl wttr.in/NY')nb. that the calling context must support bash syntax!
Offline
Thanks! That works perfectly. I see how it works: you give bash the rcfile with echo attached on top of the output, but the file itself doesn't change.
Offline