It works for me, but it is not recommended to set PATH which is used by interpreter process launcher. It may cause interpreter fail to launch.
[image: image.png] Daubignard Marion <marion.daubign...@ssi.gouv.fr> 于2021年10月19日周二 下午5:40写道: > Thanks for the answer. It works on some level, but if I set PATH using > $PATH for example, it does not. > > Since I’m not sure which part of the interpreter code makes it work, I > guess it is expected. > > > > It seems to me that the properties are set in the interpret wrapper of > AbstractInterpreter, with the InterpreterContext.set method (line 43 of > AbstractInterpreter.java). Am I right ? > > But then, how this in turn is passed onto the bash context remains a total > mystery to me. Hence I cannot really tell whether it is normal to « not > know what $PATH is »… > > > > Best regards, > > Marion > > > > *De :* Jeff Zhang <zjf...@gmail.com> > *Envoyé :* mardi 19 octobre 2021 09:33 > *À :* users <users@zeppelin.apache.org> > *Objet :* Re: Precode for abstract interpreters > > > > I don't think you need to use precode to set env. You can set env directly > in shell's interpreter setting. > > e.g. If you set ENV_1 as value_1, you can get this in shell interpreter via > > echo $ENV_1 > > > > Daubignard Marion <marion.daubign...@ssi.gouv.fr> 于2021年10月19日周二 下午3:24写道: > > Hi Jeff, > I'd like to set up some environment variables. > > Le 19 oct. 2021 05:46, Jeff Zhang <zjf...@gmail.com> a écrit : > > What kind of pre code you'd like to execute for your shell ? > > > > Daubignard Marion <marion.daubign...@ssi.gouv.fr> 于2021年10月19日周二 上午3:22写道: > > OK, so it’s not that I don’t manage to do it, actually, it’s that precode > is not what I’m looking for. > > > > Using the classname and parameter zeppelin.<classname>.precode, everytime > my java interpreter is spawned, my precode snippet is prepended to the > first bash code executed by shell. However, every time I execute my shell > interpreter, a new bash -c is spawned, and then nothing persists of my > environment. > > > > Does anyone have an idea to solve this problem ? > > > > Thanks again, > > Marion > > > > *De :* Daubignard Marion > *Envoyé :* lundi 18 octobre 2021 21:00 > *À :* users@zeppelin.apache.org > *Objet :* RE: Precode for abstract interpreters > > > > My bad… AbstractInterpreter extends Interpreter… so I guess I should > manage to make it work ; I can’t for now. Anyone tried this already ? > > > > *De :* Daubignard Marion <marion.daubign...@ssi.gouv.fr> > *Envoyé :* lundi 18 octobre 2021 20:47 > *À :* users@zeppelin.apache.org > *Objet :* Precode for abstract interpreters > > > > Hi everyone, > > I am searching the best way to initialize a few settings before running > the shell or terminal interpreters, and I realized that the precode feature > is not implemented for them, since they do not extend the Interpreter > class, but rather the AbstractInterpreter class. > > Hence, my question : is there a reason other than « this has not been done > yet » for this ? Like something incompatible with this precode feature in > the AbstractInterpreter class ? > > Thanks for your help, > > -M > > Les données à caractère personnel recueillies et traitées dans le cadre de > cet échange, le sont à seule fin d’exécution d’une relation professionnelle > et s’opèrent dans cette seule finalité et pour la durée nécessaire à cette > relation. Si vous souhaitez faire usage de vos droits de consultation, de > rectification et de suppression de vos données, veuillez contacter > contact.r...@sgdsn.gouv.fr. Si vous avez reçu ce message par erreur, nous > vous remercions d’en informer l’expéditeur et de détruire le message. The > personal data collected and processed during this exchange aims solely at > completing a business relationship and is limited to the necessary duration > of that relationship. If you wish to use your rights of consultation, > rectification and deletion of your data, please contact: > contact.r...@sgdsn.gouv.fr. If you have received this message in error, > we thank you for informing the sender and destroying the message. > > Les données à caractère personnel recueillies et traitées dans le cadre de > cet échange, le sont à seule fin d’exécution d’une relation professionnelle > et s’opèrent dans cette seule finalité et pour la durée nécessaire à cette > relation. Si vous souhaitez faire usage de vos droits de consultation, de > rectification et de suppression de vos données, veuillez contacter > contact.r...@sgdsn.gouv.fr. Si vous avez reçu ce message par erreur, nous > vous remercions d’en informer l’expéditeur et de détruire le message. The > personal data collected and processed during this exchange aims solely at > completing a business relationship and is limited to the necessary duration > of that relationship. If you wish to use your rights of consultation, > rectification and deletion of your data, please contact: > contact.r...@sgdsn.gouv.fr. If you have received this message in error, > we thank you for informing the sender and destroying the message. > > > > > -- > > Best Regards > > Jeff Zhang > > Les données à caractère personnel recueillies et traitées dans le cadre de > cet échange, le sont à seule fin d’exécution d’une relation professionnelle > et s’opèrent dans cette seule finalité et pour la durée nécessaire à cette > relation. Si vous souhaitez faire usage de vos droits de consultation, de > rectification et de suppression de vos données, veuillez contacter > contact.r...@sgdsn.gouv.fr. Si vous avez reçu ce message par erreur, nous > vous remercions d’en informer l’expéditeur et de détruire le message. The > personal data collected and processed during this exchange aims solely at > completing a business relationship and is limited to the necessary duration > of that relationship. If you wish to use your rights of consultation, > rectification and deletion of your data, please contact: > contact.r...@sgdsn.gouv.fr. If you have received this message in error, > we thank you for informing the sender and destroying the message. > > > > > -- > > Best Regards > > Jeff Zhang > Les données à caractère personnel recueillies et traitées dans le cadre de > cet échange, le sont à seule fin d’exécution d’une relation professionnelle > et s’opèrent dans cette seule finalité et pour la durée nécessaire à cette > relation. Si vous souhaitez faire usage de vos droits de consultation, de > rectification et de suppression de vos données, veuillez contacter > contact.r...@sgdsn.gouv.fr. Si vous avez reçu ce message par erreur, nous > vous remercions d’en informer l’expéditeur et de détruire le message. The > personal data collected and processed during this exchange aims solely at > completing a business relationship and is limited to the necessary duration > of that relationship. If you wish to use your rights of consultation, > rectification and deletion of your data, please contact: > contact.r...@sgdsn.gouv.fr. If you have received this message in error, > we thank you for informing the sender and destroying the message. > -- Best Regards Jeff Zhang