2014-02-18 50 views
0

我是新手腳本編寫者。使用gnome終端獲取新標籤

我在我的項目中使用了下面的代碼,但終端正在立即關閉。我想要保持終端並繼續運行

#!/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" 

我希望終端保持並繼續運行應用程序。

如果我使用的方法或語法錯誤,請糾正我的錯誤。

回答

0

gnome-terminal

- go to Edit -> Profiles.

Default輪廓

- 單擊Title And Command選項卡上單擊 - 雙色。

- 從位於窗口底部的when command exits列表中選擇Hold Terminal Opens

--close窗口

現在運行腳本,將工作

或者你也可以添加您的個人資料,並運行腳本如下

點擊New標籤。並給出您的配置文件名稱

選擇從標有「何時」命令退出的下拉菜單中按住終端。您應該創建一個新的配置文件,並與

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

執行要使終端停留在命令退出:

konsole有一個--noclose標誌。

xterm,有一個-hold標誌。