Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re: Creating bash functions using perls $ENV interface

by graff (Chancellor)
on Oct 29, 2003 at 05:03 UTC ( [id://302922]=note: print w/replies, xml ) Need Help??


in reply to Creating bash functions using perls $ENV interface

If you would like to invoke two separate shell scripts in a single shell session, try this -- at least, this is how I would do it on *nix... Frankly, I'm not sure this can be done in a windows environment, but it might be worth a try:
open( SH, "| /path/to/bash" ) or die "Can't open a shell: $!"; my @scripts; { local $/ = undef; for my $file ( "first_shell_script", "second_shell_script" ) { open( SCR, $file ) or die "couldn't read $file: $!"; push @scripts, <SCR>; close SCR; } } print SH $scripts[0]; print SH $scripts[1]; # and then do whatever magical stuff this shell can do, # now that it has these scripts in its arsenal...

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others exploiting the Monastery: (6)
As of 2024-04-23 14:39 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found