V
V
Vampre2020-06-06 08:52:20
linux
Vampre, 2020-06-06 08:52:20

Why doesn't a bash script execute a command in a new tab?

Wrote a simple bash script

#!/bin/bash
gnome-terminal --tab --title="newtab" -- "bash -c \"ls\""


As a result, I get the following error:
5edb2edee17d2338165381.png

If you simply execute gnome-terminal --tab --title="newtab", then the tab opens normally.

PS: ubuntu 18

Answer the question

In order to leave comments, you need to log in

2 answer(s)
X
xotkot, 2020-06-06
@Vampre

gnome-terminal --tab --title="newtab" -- $SHELL -c 'ls && $SHELL'

or even like this:
gnome-terminal --tab --title="newtab" -- $SHELL -c 'ls && sleep 5'

S
SOTVM, 2020-06-06
@sotvm

Lots of extra bukaf. Be humble)))

gnome-terminal --tab --title="newtab" -e 'man gnome-terminal'

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question