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

Re^2: perl scripting help

by ejm20 (Initiate)
on Jun 01, 2021 at 14:36 UTC ( #11133367=note: print w/replies, xml ) Need Help??

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

This node falls below the community's threshold of quality. You may see it by logging in.

Replies are listed 'Best First'.
Re^3: perl scripting help
by kcott (Archbishop) on Jun 02, 2021 at 07:03 UTC

    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://11133367]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others studying the Monastery: (1)
As of 2022-09-30 19:20 GMT
Find Nodes?
    Voting Booth?
    I prefer my indexes to start at:

    Results (126 votes). Check out past polls.