Score:0

Opening a terminal in a shell script, running a command on it, and keeping it open

cn flag

I want to open a gnome-terminal from a shell script, run a command on it, and keep it open when the command's execution is over.

This is what I tried:

#!/bin/sh
gnome-terminal -- bash -c 'echo "test"; sleep 5'

This opens a terminal window showing only the output of the echo test and it closes after the sleep is over. I want it to prompt a new line when the execution is over. How can I do that?

bac0n avatar
cn flag
exchange `sleep 5` with `exec bash`
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.