I want to launch several applications using “./application_name” and each in separate terminal , how do i do that in bash script.
I want to launch several applications using ./application_name and each in separate terminal ,
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
I am not sure I understand what you are asking for, but this is probably what you need:
This will start a new terminal emulator in the background which will be running the given command instead of a shell.
If you system does not have a
x-terminal-emulatoralias, substitute the name of an actual terminal emulator, likextermorgnome-terminal. They (pretty much) all support the-eoption.Of course this requires that your bash script be running from inside an X11 session in the first place (not from a cron job or something like that), else there will be no
$DISPLAYwhere the new terminal emulators can appear.EDIT: Whether or not the argument to
-eis executed under a shell or directly seems to depend on which terminal emulator is used. For example,xtermruns it under a shell butgnome-terminaldoesn’t. The upshot of this is that you may or may not be able to supply compound shell commands likecd foobar; ./something & waitas the argument to-e. As a workaround for those terminal emulators that don’t run the command under a shell, you can use-e 'sh -c "actual command"'. Proper quoting of special characters gets gets complicated because you have two levels of quoting, but it can be done.