jahst
November 8th, 2010, 01:26 PM
Hello,
Trying to figure out why this same command behaves differently when run as a normal user than it does when run as root.
Here is the code:
for i in 0{5..6}; do gnome-terminal -x sh -c "echo hello $i && sleep 10" ; done
When run as a normal user, it pops up 2 separate terminals at the same time, both echo the respective 5 and 6, and then both close after 10 seconds. Total time = 10 seconds for both terminals as they run simultaneously.
However, when I change to root...
sudo su
then post the same command, it opens one terminal. runs the command for 5.. closes the terminal after 10 seconds... then opens another terminal and runs the command for 6.. and closes after 10 seconds. Total time = 20 seconds, as they run sequentially.
Why is this so? .. and how do I make it run simultaneously as root like it does for normal user?
Another thing...
my terminal as normal user looks like this
user@hostname:~$
and as root it looks like
root@hostname:/#
Granted.. I've never taken much time to look at the root terminal prompt.. but shouldn't it be more like:
root@hostname:~$ or
root@hostname:~#
Thanks,
Trying to figure out why this same command behaves differently when run as a normal user than it does when run as root.
Here is the code:
for i in 0{5..6}; do gnome-terminal -x sh -c "echo hello $i && sleep 10" ; done
When run as a normal user, it pops up 2 separate terminals at the same time, both echo the respective 5 and 6, and then both close after 10 seconds. Total time = 10 seconds for both terminals as they run simultaneously.
However, when I change to root...
sudo su
then post the same command, it opens one terminal. runs the command for 5.. closes the terminal after 10 seconds... then opens another terminal and runs the command for 6.. and closes after 10 seconds. Total time = 20 seconds, as they run sequentially.
Why is this so? .. and how do I make it run simultaneously as root like it does for normal user?
Another thing...
my terminal as normal user looks like this
user@hostname:~$
and as root it looks like
root@hostname:/#
Granted.. I've never taken much time to look at the root terminal prompt.. but shouldn't it be more like:
root@hostname:~$ or
root@hostname:~#
Thanks,