Your post is virtually unreadable. Why did you post it like this? Surely you saw this in the initial preview along with the message: "If something looked unlike you expected it to you might need to check out Writeup Formatting Tips". Please follow that link and also read "How do I post a question effectively?" before posting again.

I created a new directory ~/tmp/pm_11133222_test_dir and this file:

ken@titan ~/tmp $ cat > pm_11133222_rcfile . ~/.bashrc cd ~/tmp/pm_11133222_test_dir

I modified the script I originally gave you. It's now:

#!/usr/bin/env perl use strict; use warnings; use autodie ':all'; my @commands = ( 'set -vx', 'pwd', "cd $ENV{HOME}", 'pwd', 'date', "/usr/bin/bash --rcfile $ENV{HOME}/tmp/pm_11133222_rcfile -i", ); system qw{/usr/bin/xterm -e}, join ';', @commands;

When I run that, I get an xterm window with this content:

+ pwd /home/ken/tmp + cd /home/ken + pwd /home/ken + date Wed, 2 Jun 2021 16:38:27 + /usr/bin/bash --rcfile /home/ken/tmp/pm_11133222_rcfile -i ken@titan ~/tmp/pm_11133222_test_dir $

All of my previous comments about the script being blocked and exiting from the xterm still apply.

— Ken


In reply to Re^3: perl scripting help by kcott
in thread perl scripting help by ejm20

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.