#! /bin/csh -f # first argument is the filename of the crylsq .pch atom pos file # remote shell runs Mathematica to diagonalise vibration tensors # set at = `echo $cwd` @ line = ` rsh graf "ps aux | egrep Math " | awk ' END {print NR}'` if ($line >= 4) then echo ' It aint your day baby ' exit else echo ' afile1= "'$at'/'$1'" ;\ OpenRead[afile1];\ While[1==1,\ While[test=Read[afile1,Table[Character,{3}]];\ If[SameQ[test,EndOfFile],Break[]];\ Not[SameQ[ToExpression[test],{U, I, J}]], \ fchk = Read[afile1,String] ];\ If[SameQ[test,EndOfFile], Break[]];\ alabel = StringJoin[Read[afile1,Table[Character,{8}]]];\ u = Read[afile1,Table[Number,{6}]];\ matrix = {{u[[1]],u[[4]],u[[5]]},{u[[4]],u[[2]],u[[6]]},{u[[5]],u[[6]],u[[3]]}};\ Print[ " "] ; Print[ " "];\ Print[alabel];\ Print[ " "];\ Print[Eigenvalues[matrix]];\ Print[MatrixForm[Eigenvectors[matrix]]];\ Read[afile1,String] ]\ Close[afile1];\ Print["Done baby"]\ Exit[] ' | rsh graf "/usr/local/Mathematica_2.0/bin/math" endif echo ' '