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 > UNIX for Dummies Questions & Answers
.
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 07-06-2008
jim mcnamara jim mcnamara is offline Forum Staff  
...@...
  
 

Join Date: Feb 2004
Location: NM
Posts: 5,759
Code:
#bin/ksh
let max=0
while true
do
    echo "enter a number zero to quit \c"
    read num
    [[ $num -eq 0 ]] && break
    if [[ $num -gt $max ]] ; then
          max=$num
    fi
done
[[ max -gt 0 ]] && echo $max
This requirement sounds like homework - against our rules. If this is, and your teacher sees this, he will know it is plagiarized-- assuming he knows any shell code.

We do not do homework for you here.