in reply to sourcing
The basic idea is that the subprocess--the perl script--should print shell commands to its stdout, which the parent process--the shell--would capture and execute. For instance, here's a trival script to set your terminal type:
Run it like this:#!/usr/local/bin/perl print "TERM=", $ARGV[0], " export TERM\n";
and your shell will dutifully set its TERM variable to vt100 (assuming you're using a bourne-like shell).eval `myterm vt100`
The subprocess may need to look at the SHELL environment variable so that it can produce sh or csh style output as appropriate. And the user wanting to use this command may want to set up an alias or shell function to make the command easier to type.
The unix "resize" command uses this technique. You should take a look at its man page.
|
|---|