#!/usr/bin/env perl use strict; use warnings; use autodie ':all'; my @commands = ( 'set -vx', "cd $ENV{HOME}", 'date', 'pwd', '/usr/bin/bash -i', ); system qw{/usr/bin/xterm -e}, join ';', @commands; #### + cd /home/ken + date Sat, 29 May 2021 10:44:54 + pwd /home/ken + /usr/bin/bash -i ken@titan ~ $ #### ken@titan ~/tmp $ ./pm_11133222_xterm.pl & [1] 2182 ken@titan ~/tmp $ #### ken@titan ~/tmp $ [1]+ Done ./pm_11133222_xterm.pl ken@titan ~/tmp $ #### system qw{/usr/bin/gnome-terminal -- /usr/bin/bash -c}, join ';', @commands; #### ** (gnome-terminal:2292): WARNING **: Error retrieving accessibility bus address: org.freedesktop.DBus.Error.NoReply: Message recipient disconnected from message bus without replying #### $ NO_AT_BRIDGE=1 ./pm_11133222_gnome.pl $ ./pm_11133222_gnome.pl 2> /dev/null