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 -->
  #2 (permalink)  
Old 10-13-2008
cfajohnson's Avatar
cfajohnson cfajohnson is offline Forum Advisor  
Shell programmer, author
  
 

Join Date: Mar 2007
Location: Toronto, Canada
Posts: 2,372

You may have difficulty getting help with csh scripts, because it is not very good for scripting. See these articles for reasons why that is so:
Top Ten Reasons not to use the C shell
C shell problems
Csh Programming Considered Harmful
In a Bourne-type shell, you might do this:


Code:
for port in port-1 port-2 port-3 port-4
do
  printf "<sourcePort>daughtercard:%s</sourcePort>\n" "$port"
done

Or even:


Code:
printf "<sourcePort>daughtercard:%s</sourcePort>\n" \
       port-1 port-2 port-3 port-4