Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical

Re^3: perl scripting help

by kcott (Archbishop)
on Jun 02, 2021 at 07:03 UTC ( #11133396=note: print w/replies, xml ) Need Help??

in reply to Re^2: perl scripting help
in thread perl scripting help

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

Log In?

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11133396]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (5)
As of 2022-12-01 15:57 GMT
Find Nodes?
    Voting Booth?