code_junkie

Unix C Shell Scripting printf help

Nov 12th, 2011
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.45 KB | None | 0 0
  1. foreach finalList ($correctList $wrongList)
  2. printf "%20s%sn" $finalList
  3. end
  4.  
  5. Correct Incorrect
  6. Good1 Bad1
  7. Good2 Bad2
  8. Good3 Bad3
  9.  
  10. Good1 Bad1 Good2 Bad2
  11.  
  12. # Get the max index of the smallest list
  13. set maxIndex = $#correctList
  14. if ( $#wrongList < $#correctList ) then
  15. set maxIndex = $#wrongList
  16. endif
  17.  
  18. set index = 1
  19. while ($index <= $maxIndex)
  20. printf "%-20s %sn" "$correctList[$index]" "$wrongList[$index]"
  21. @ index++
  22. end
Add Comment
Please, Sign In to add comment