Page 1 of 1

Looping gnome?

Posted: 2019-02-16 18:47
by Munty Scruntfundle
Hi folks.

If I type:

Code: Select all

gnome-terminal -e 'ssh user@ sudo apt-get -y update'
a terminal opens, the command runs and I see output.

If I put the following in a script ($line is the ip address in the nodes file):

Code: Select all

while read line; do
        gnome-terminal -e 'ssh user@'$line' sudo apt-get -y upgrade'
        sleep .5
done </mybin/nodes
a terminal opens, starts to run, then closes after the sleep.

How can I make this loop run so each gnome will stay open and complete the task?

Many thanks.

Re: Looping gnome?

Posted: 2019-02-16 19:08
by Munty Scruntfundle
My fault. I'm an idiot.

I was testing with a list of nodes that are already up to date. I'm so tired!