[bash] Extra tab opens


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting [bash] Extra tab opens
# 1  
Old 11-19-2018
[bash] Extra tab opens

Hello everyone,

This code is working right using mate-terminal but with xfce4-terminal for some reason, it open up an extra tab...

Could someone please help me out to understand why this is happening?

Code:
#!/bin/bash

cd "$(dirname "$0")"/files

tab=" --tab"
title=" --title"

options=()

cmds[0]="./script1.sh"
cmds[1]="./script2.sh"
cmds[2]="./script3.sh"

tabName[0]="tab name 1"
tabName[1]="tab name 2"
tabName[2]="tab name 3"

for i in 0 1 2; do
	options+=($tab $title "${tabName[i]}" -e "bash -c '${cmds[i]} ; bash'" )
done
xfce4-terminal --geometry=102x9 "${options[@]}"	
exit 0

# 2  
Old 11-20-2018
Try printf "[%s]\n" xfce4-terminal --geometry=102x9 "${options[@]}" to see exactly what options you're feeding in. Each option will be its own line, surrounded by [ ] .
# 3  
Old 11-20-2018
Quote:
Originally Posted by Corona688
Try printf "[%s]\n" xfce4-terminal --geometry=102x9 "${options[@]}" to see exactly what options you're feeding in. Each option will be its own line, surrounded by [ ] .
I did has you suggested and I got the following:

Code:
[xfce4-terminal]
[--geometry=102x9]
[--tab]
[--title]
[tab name 1]
[-e]
[bash -c './script1.sh ; bash']
[--tab]
[--title]
[tab name 2]
[-e]
[bash -c './script2.sh ; bash']
[--tab]
[--title]
[tab name 3]
[-e]
[bash -c './script3.sh ; bash']

Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Bash menu opens and closes

Ever since I added these two code blocks to my bash menu it just opens and closes right away. I use a batch file that worked fine until these codes were added and I am not sure what is wrong. Basically, what I am trying to do in the additional section is if the answer is "Y" then it goes back... (13 Replies)
Discussion started by: cmccabe
13 Replies

2. UNIX for Dummies Questions & Answers

Bash Tab Completion Hanging

Hi, I'm having a problem with tab completion at the bash command line. For some reason, whenever I type g<tab>, the terminal will freeze up for 5-10 seconds before asking me if I want to display all 325 possibilities. I thought that maybe it's because of the high number of commands, but I have... (4 Replies)
Discussion started by: Raz716
4 Replies

3. Shell Programming and Scripting

Dividing tab blocks in bash script

Hi everyone, I have a data.xml file which only contains thousands of data (tag) blocks. A part of the file looks exactly like this; <data> Line Line Line </data> <data> Line Line Line </data> the rest of the file is simply a repetition of this part. Here each data block contains a... (8 Replies)
Discussion started by: hayreter
8 Replies

4. Shell Programming and Scripting

[Solved] SED - Bash - Inserting multi Tab character in the command

Hello. I am using : sed -i -e '/§name_script§/a#'"${MY_TAB11}"'# \ #'"${MY_TAB1}"'The Standard way'"${MY_TAB7}"'# \ #'"${MY_TAB1}"'==============='"${MY_TAB7}"'# \ ' "$CUR_FILE" Is there a better way to define "MY_TAB7","MY_TAB11" in other way than : MY_TAB1=$'\t' MY_TAB2=${MY_TAB1}$'\t'... (2 Replies)
Discussion started by: jcdole
2 Replies

5. Shell Programming and Scripting

Bash shell adding extra single quotes

AIX 6.1 bash shell #!/bin/bash -x STATEMENT="cvs commit -m \"This is\" ../PBP/EIR.ENTRY" echo $STATEMENT exit 0 This is the output + STATEMENT='cvs commit -m "This is" ../PBP/EIR.ENTRY' + echo cvs commit -m '"This' 'is"' ../PBP/EIR.ENTRY cvs commit -m "This is" ../PBP/EIR.ENTRY + exit... (26 Replies)
Discussion started by: hpodhrad
26 Replies

6. Shell Programming and Scripting

Convert a tab separated file using bash

Dear all, I have a file in this format (like a matrix) - A B C .. X A 1 4 2 .. 2 B 2 6 4 .. 8 C 3 5 5 .. 4 . . . ... . X . . ... . and want to convert it into a file with this format: A A = 1 A B = 4 A C = 2 ... A X = 2 B A = 2 B B = 6 etc (2 Replies)
Discussion started by: TheTransporter
2 Replies

7. Shell Programming and Scripting

Bash script [Press Tab] Screen Blank..

Dear Member, OLD Question --> disable-completion not solved My bash Menu script ping process problem. If ping still running and users press SCREEN is Blank... Cant Members help me.. kill signal or others scripting for my case, btw i use Linux.. Thanks, Rico My Bash Script : ... (1 Reply)
Discussion started by: carnegiex
1 Replies

8. Shell Programming and Scripting

[tcsh2bash] Tab completion - 'enhanced' equivalent in bash?

I really like tcsh's: set completion='enhanced' because it treats underscores and dash signs the same. I don't have to reach for the shift key when trying to complete files that have underscores. As far as I know, there is nothing like this in bash. Does such a thing exist in bash? If... (2 Replies)
Discussion started by: sarnobat
2 Replies

9. Shell Programming and Scripting

processing tab-formated output of command w/bash

I have a command that when ran it will have an output such as string LongerString string2 longerString2 More MoreStrings seperated by tabs. The command lists domains and their accounts set up in my server admin software (interworx). The end result will be that it will run rsync for... (2 Replies)
Discussion started by: sweede
2 Replies

10. UNIX for Dummies Questions & Answers

VI opens slow

when ever I try to vi a file that resides on another machines it takes forever for it to open. Does anyone have any ideas why it would be doing this? I have 7 unix machines and the only two that do this are both running tru64. (6 Replies)
Discussion started by: Moca4444
6 Replies
Login or Register to Ask a Question