1

I'm using a tool (Autokey) that spawns in a new shell. Cool tool, but I want to pull info from my current shell.

Say I'm on pts/0 and I have a variable set: VAR1=yes. In another shell, I want to be able to read the variable from pts/0 and take action accordingly. Would also be nice to be able to set the variable. Any way to do either?

MORE INFO THAT YOU DON'T NEED TO READ (probably): What I'm doing is creating a reliable way to set up my environment on ANY remote *nix box (AIX, RHEL, SuSE). With one key combo, I run bash, set -o settings, set EDITOR and VISUAL, etc.

NFS is not reliably available. I could change my profile but I can't change root's or I screw it up for the other admins. Essentially, I'm left with whatever I can do over ssh. And it works the way I have it - it's just not pretty. I'd prefer something interactive.

For my specific situation, I've considered saving the variable to a file. That works, as long as I'm local. If I ssh out, saving a file remotely doesn't work.

The tool uses Python so maybe there's a way in Python to read a variable from another shell. I doubt that Python would be able to if Bash can't.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.