The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com




View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #1 (permalink)  
Old 06-05-2008
ROOZ ROOZ is offline
Registered User
  
 

Join Date: Mar 2008
Posts: 48
for:badly formed number

Hi,
I am doing the following but it complains and says "for:badly formed number"
does anyone know why?

#!/bin/tcsh
foreach(....)
............

set depth=64
set width=23
if ($depth==64) then
echo "if"
set addr_bits=5
else
echo "else"
endif

echo "addr_bits:$addr_bits"
echo "depth:$depth"
echo "width:$width"

end


Guys please note that i need to use #!/bin/tsch because foreach will not work without it. becuase the if statement works fine just the way it is if i don't use #!/bin/tsch and i do the following
depth=64
if ($depth==64) then
echo "if"
addr_bits=5
else
echo "else"
endif

the problem occurs when i use #!/bin/tcsh