Stack Exchange network consists of 183 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.
I don't understand what "in one line" is supposed to mean as cmd1 ; cmd2 is probably not what you are looking for. If you need this structure often and want to reduce code then you can write a function which calls its parameter like the two example lines.
timeout --signal=SIGKILL 10s { timeout --signal=SIGINT 5s command ; }
ortimeout --signal=SIGKILL 10s bash -c 'timeout --signal=SIGINT 5s command'
?cmd1 ; cmd2
is probably not what you are looking for. If you need this structure often and want to reduce code then you can write a function which calls its parameter like the two example lines.