The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

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 -->
  #3 (permalink)  
Old 06-05-2008
ROOZ ROOZ is offline
Registered User
  
 

Join Date: Mar 2008
Posts: 48
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/'`

if ($depth==64) then

set addr_bits=5
endif

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

end