I'm using an automation engine to run perl scripts. script_X requires a wrapper script so it's run like:

wrapper_script script_X --parameters

But the automation engine can't understand that invocation. At the moment, I've manually edited ./bashrc to say:

alias script_X='wrapper_script script_X'

I'm currently testing to see if the automation engine will work with this. It can however handle environment variables.

Is it possible to export an environment variable to create/modify an alias?

(From comments, I realise this may be a convoluted method to solve a limitation, however I'm still interested in the answer to the original question, out of curiosity)

  • 1
    How does the "automation engine" understand enough to run script_X (in theory) but not a wrapper script? what problem do you really want to solve? – Jeff Schaller May 27 '16 at 16:12
  • it doesn't understand "wrapper script script_X". It understands wrapper_script and script_X but neither do what I want them to. I want to investigate if this is possible before I think about talking to the automation engine developers – ponytailPalm May 27 '16 at 16:14
  • 1
    can you define "script_XY" that is a simple script that's a double-wrapper -- it in turn calls wrapper_script with the necessary parameters? seems a really convoluted way to work around some sort of limitation. – Jeff Schaller May 27 '16 at 16:42
  • This is impossible to answer without seeing wrapper_script and probably script_X too. What does wrapper_script do? Why does script_X need it? Is script_X executable (e.g. chmod +x). Add this info to your question, not in a comment. – cas May 28 '16 at 3:03
  • Wrapper_script is needed because of perl comparability issues. Whether it's a convoluted method or not - I'm still interested in whether it's possible to modify an alias with an env var – ponytailPalm May 30 '16 at 14:29

Have you tried to hashbang the script_X with the path of the right interpreter(wrapper_script).

(...blabla contents of script_X)

where /bin is of course, the right path to the wrapper_script. With that will just need to:

chmod +x script_X 

This can solve your problem?

| improve this answer | |

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.