[Sidefx-houdini-list] Running a script to setvariablesfromaC-shell script

Robert Persons robert at adtechinc.com
Tue Feb 28 13:04:37 EST 2006


I appreciate the suggestions:  I think my problem is in that I'm trying
to set a variable within hscript, from a c shell.

Here's a simplification of what I'm doing:
------------------------------------------------
The simplified render script is:

#! c:/bin/csh -f
source c:/rob/.aliases

hsc a.hip << ENDREND

# These work
set a = 1
set b = 2

echo $a
echo $b

# These don't work
bunchofvariables
source bunchofvariables

echo res = $renw X $renh " " $renx

quit
ENDREND

#shutdown.exe -s

----------------------------------------------
The simplified "bunchofvariables" script is:

# Set resolution of renders to 360 x 240 .9

set renw = 360
set renh = 240
set renx = .9

echo res = $renw X $renh " " $renx

--------------------------------------------

The echo commands in the bunchofvariables script work (showing the
variables are set there), but they don't change the variables within
hscript. I tried using "setenv" to no avail. I'm suspecting there is
some syntax issue.

My shortcut way to test this is to open a text window within graphical
Houdini and run the source commands ... then check to see if the
variables actually change.  When I use "set" directly they do, when I
source a file of "sets" they don't.

Thanks,

Robert

-------------------------------------
Robert Persons
Adtech Communications Group
952-944-6347
-------------------------------------
mailto:robert at adtechinc.com




-----Original Message-----
From: sidefx-houdini-list-bounces at sidefx.com
[mailto:sidefx-houdini-list-bounces at sidefx.com] On Behalf Of Rick Walia
Sent: Monday, February 27, 2006 6:32 PM
To: sidefx-houdini-list at sidefx.com
Subject: Re: [Sidefx-houdini-list] Running a script to
setvariablesfromaC-shell script

Robert Persons wrote:

> That would seem to make sense, but I tried it and the variables don't
> get set ... hmmmm
>
Interesting. I just tried at it works for me.
I have 2 files:
foo.csh
test.csh

In foo.csh I have:
#-------------------------
#!/bin/tcsh
setenv FOO "this is foo"
set morestuff = "this is more text from foo"
#-------------------------

in test.csh I have:
#-------------------------
source $HOME/foo.csh
echo $FOO
echo $morestuff
#-------------------------

If I chmod a+x foo.csh test.csh and run ./test.csh, the output is:
#-------------------------
this is foo
this is more text from foo
#-------------------------

hope this helps


-- 
Rick Walia

The Mill 




_______________________________________________
Sidefx-houdini-list mailing list
Sidefx-houdini-list at sidefx.com
https://lists.sidefx.com:443/mailman/listinfo/sidefx-houdini-list






More information about the Sidefx-houdini-list mailing list