Jump to content

Use hscript to set linux variable


Mzigaib

Recommended Posts

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 by Mzigaib
Link to comment
Share on other sites

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.

Link to comment
Share on other sites

  • 2 weeks later...

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.

Link to comment
Share on other sites

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. 

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...