system() in shell script/hscript

   2876   1   1
User Avatar
Member
30 posts
Joined: July 2005
Offline
hello, i have hscript in a shell script



#! /bin/csh -f

#check to see if user suppled the correct number of arguments
#- exit if not

if ($#argv < 4) then
echo “USEAGE: ren_script <hip_file> <out_file> <start> <end>”
exit
endif

# set up user supplied arguments

set HIP_FILE = $1
set OUT_FILE = $2
set START = $3
set END = $4
# start up hscript and allow commands to be sent from C shell

hscript << ENDCAT >& renlog

mread $HIP_FILE
opcd \/out

for i = $START to $END
echo date: `system ( “date” )`
end

ENDCAT




i get a “Badly places ()'s” error. ive tried different combinations of slashes, quotes, etc.

system(“date”) works in the textport.
User Avatar
Member
2199 posts
Joined: July 2005
Online
It's been a long time since I did any csh with Houdini, but if something works in the textport but not when you script it then it's worth trying to escape stuff that might be parsed before it gets to hscript. In this case the brackets.

echo date: `system\(“date”\)`

total guess though, I can't test this at the moment.
The trick is finding just the right hammer for every screw
  • Quick Links