Bash scripting

Discussion in 'Linux, BSD and Other OS's' started by Impotence, May 2, 2007.

  1. Impotence

    Impotence May the source be with u!

    Likes Received:
    6
    Trophy Points:
    38
    hey all,

    I've been playing around with scripts recently i have been wondering how to spawn a new shell and run a command inside it?

    I have had a good look around but all i could find was 'subshell' which doesn't spawn a new window, it just creates it inside the current one :( (I even tried looking through a script that did spawn new windows, 'airoscript' on backtrack, but i couldn't work out how it was doing it :( )
     
  2. jpalfree

    jpalfree Geek Trainee

    Likes Received:
    0
    Trophy Points:
    0
    Well, I don't know what terminal you want to pop up (xterm, gnome-term, aterm...) but I know with xterm you can use something like this:
    Code:
    $ xterm -e "echo Hello New Terminal; sleep 5"
    which will pop up an xterm and in it will be printed... "Hello New Terminal". After five seconds it will close the terminal (because sleep will end).

    Hope that helps.
     
  3. Impotence

    Impotence May the source be with u!

    Likes Received:
    6
    Trophy Points:
    38
    Wonderful :D thankyou jpalfree! :beer:
     

Share This Page