Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re^2: CSH script that calls a perl script

by McA (Priest)
on Oct 17, 2012 at 07:30 UTC ( #999471=note: print w/ replies, xml ) Need Help??


in reply to Re: CSH script that calls a perl script
in thread CSH script that calls a perl script

Hi,

just an addition to that what ig said: Let the perl script generate shell variable assignments like SOME=thing, capture the output of the perl script and evaluate it in the context of the csh script. Than you have the return values in the variables of the csh script. But be careful with variable interpolation, shell meta characters and all that stuff.

But the core of the idea is: Generate something which can be directly interpreted with csh. A kind of serialize to something that can be deserialized by csh.

Best regards
McA


Comment on Re^2: CSH script that calls a perl script
Download Code
Re^3: CSH script that calls a perl script
by MidLifeXis (Prior) on Oct 17, 2012 at 12:21 UTC

    As an example on this method, ssh-agent does this. eval `ssh-agent PARAMS`. ssh-agent generates the commands that the shell will then evaluate.

    OT: In a previous life I also used this method to set up user accounts at a university to have the proper environment for their classwork (see modules). A user's account, on login, would read configuration files that would generate the appropriate variables, aliases, path settings, and other schtuff specific to their coursework or other projects that they were participating in. The shell (independent of which one they used) would then evaluate these shell commands that were generated. It made my life as an admin much easier, the user accounts much more consistent and predictable, and allowed the professors the ability to request applications and configurations particular (or peculiar) to their classes. Not certain if I would use this particular implementation again, but it did work well in the mid 1990's.

    --MidLifeXis

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (4)
As of 2014-12-29 04:51 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (184 votes), past polls