简体   繁体   中英

Using of gnome terminal to get new tab

I'm new to scripting.

I'm using the below code in my project, but the terminal is getting closed instantly. I want the hold the terminal and keep running

#!/bin/bash/

gnome-terminal --tab --working-directory="/home/sandhya/OpenBTS/public/openbts/trunk/apps/" -e "file = grep OpenBTS /home/sandhya/OpenBTS/public/openbts/trunk/apps \
if [ -f $file ] \
then \
         echo " file exits" \
     sudo "/home/sandhya/OpenBTS/public/openbts/trunk/apps/OpenBTS" \

fi" 

I want the terminal to be stay and keep running the application.

Please correct me in case the method or syntax I used is wrong.

In gnome-terminal ,

-- go to Edit -> Profiles.

--Double click on Default profile

--Click on Title And Command tab.

--Select Hold Terminal Opens from when command exits list which located at bottom of window.

--close windows

Now run your script it will work

Or you can also add your profile and run script as follows

Click the New tab. and give your profile name

Select Hold the terminal from the drop-down menu labelled When command exits. You should create a new profile for that and execute with

gnome-terminal --window-with-profile=NAMEOFTHEPROFILE -e command

To make the terminal stay when the command exits:

In konsole there is a --noclose flag.

In xterm , there is a -hold flag.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM