The UNIX and Linux Forums  


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




Thread: foreach loop
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
joeyg's Avatar
joeyg joeyg is offline Forum Staff  
modérateur
  
 

Join Date: Dec 2007
Location: Home of 17-time world champion Boston Celtics
Posts: 1,311
check the set depth line


Code:
set depth=`echo "$string"

It looks like you are missing a `
Personally, I like setting a variable such like


Code:
depth=$(echo "$string")

The command is now inside ( ) and less chance of missing a special character.