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
i) please use the code markup tag and indention for better readability
ii) there's no single for in your snippet which depends on numbers
iii) it would be interesting to know what's inside foreach(...)
here is the actual code. note that testing1 consist of couple of line lets say asdaskljl64x3sdfsd is the first line of the testing1 file
#!/bin/tcsh
foreach filename (`cat testing1`)
set string=$filename
set depth=`echo "$string" | sed -e 's/^[^0-9]*\([0-9][0-9]*\)./\1/'`
set width=`echo "$string" | sed -e 's/.*\([0-9][0-9]*\)[^0-9]$/\1/'`