Mzigaib Posted July 21, 2018 Share Posted July 21, 2018 (edited) I am trying to use the 'unix' hscript command to set the 'JOB' variable to my linux shell from inside Houdini but so far no success I got an 'not valid identifier' error if I do this: unix export JOB=$JOB I know I could use python but I am trying to use script for this one. Any tips? Thanks in advance. Edited July 21, 2018 by Mzigaib Quote Link to comment Share on other sites More sharing options...
Mzigaib Posted July 21, 2018 Author Share Posted July 21, 2018 Anyone? Quote Link to comment Share on other sites More sharing options...
bonsak Posted July 22, 2018 Share Posted July 22, 2018 (edited) Whats the output if you run echo $JOB in the Textport? In the hscript docs theres a setenv and a set function http://www.sidefx.com/docs/houdini/commands/setenv.html Have you tried that? Edited July 22, 2018 by bonsak Quote Link to comment Share on other sites More sharing options...
LaidlawFX Posted July 22, 2018 Share Posted July 22, 2018 What Bonsak said. Though you should really just do this in Python. Hscript has not been updated in many years, on it's way towards depreciation. Quote Link to comment Share on other sites More sharing options...
Mzigaib Posted July 22, 2018 Author Share Posted July 22, 2018 I am already used to hscript for years since H9 the reason I never used python it is because I never had to hscript gives me everything I need inside H. the 'setenv' command only set the environment inside H shell I want to be able to export it to my linux shell with hscript but I think it's not possible and for this case I think you are right python is the way to go. I can go to the window>shell command that H opens up a shell with the variables that I need but I wanted to be able to do it without have to open another window with script. Anyway thanks for the feedback. Quote Link to comment Share on other sites More sharing options...
LaidlawFX Posted July 23, 2018 Share Posted July 23, 2018 Yeah I migrated from hscript and perl a few years ago. I still don't know why I learned perl... But pipelines are so much more immensely easier to write now. Stack overflow is my hero. Good Luck Sir! Quote Link to comment Share on other sites More sharing options...
lukeiamyourfather Posted July 23, 2018 Share Posted July 23, 2018 Setting an environment variable applies only to the existing shell process and nothing else. What are you trying to do in the bigger picture that needs this? Quote Link to comment Share on other sites More sharing options...
Mzigaib Posted August 2, 2018 Author Share Posted August 2, 2018 I just want to send some Houdini environment to the linux shell like the $JOB or the $HIPFILE so I can do stuff in the terminal like "hbatch $HIPFILE" without the have to copy or write any lines from Houdini to the terminal, nothing fancy. I hope that makes sense. Quote Link to comment Share on other sites More sharing options...
symek Posted August 2, 2018 Share Posted August 2, 2018 You can't send env. variable back to parent process (shell) from within Houdini. It's not hscript nor Houdini limitation, it's just how system works. Env. variables are inherited by child processes (like Houdini), which means it sees the copy of it. You could start new shell process from Houdini, so that new process will inherit vars as set by you inside Houdini. Quote Link to comment Share on other sites More sharing options...
LaidlawFX Posted August 3, 2018 Share Posted August 3, 2018 My new best friend as of late. https://docs.microsoft.com/en-us/sysinternals/downloads/process-explorer When you click on a process in the properties you can see the environment variables for that process and level. It shows what symek is talking about about inheritance. Quote Link to comment Share on other sites More sharing options...
Mzigaib Posted August 3, 2018 Author Share Posted August 3, 2018 Thanks for the info guys, it helps a lot. The easiest way I do use the 'interchange' environment variables between Houdini and the shell is like I said before I go to window>shell and Houdini creates one for me with the environments that I need. PS: I am using Linux. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.