Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re: Returning from a program

by graff (Chancellor)
on Aug 12, 2002 at 21:28 UTC ( [id://189641]=note: print w/replies, xml ) Need Help??


in reply to Returning from a program

If kshell supports the same kind of shell variable assignments that are typical in (ba)sh, then something like this ought to work:

The perl script simply prints the name of the selected file to stdout, terminated by a line-feed.

The perl script is invoked from kshell using backticks, in a construct like the following:

ENV_FILE=`selection_script.perl` setup_env ENV_FILE

Unlike the perl backtick operator, the use of backticks in (ba)sh returns the output of the command with all line-feeds converted to spaces.

update: revised the shell script to reflect the example given by peschkaj.

Log In?
Username:
Password:

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

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

    No recent polls found