Kyle R. Burton on 20 Feb 2006 01:09:44 -0000 |
> If one doesn't exist it returns 2. That actually leads to a pretty clean usage of just case: cmp -s "$1" "$2" case "$?" in 0) echo "Files both exist and are the same..." ;; 1) echo "Files both exist and are the different." ;; 2) echo "One or both of the files do not exist!" ;; *) echo "Hrm, the exit code was: $?, no clause to handle htat..." ;; esac That easily and explicitly covers all the bases. Thanks for suggesting case, I'll start using that more now that I think of it this way. Kyle ___________________________________________________________________________ Philadelphia Linux Users Group -- http://www.phillylinux.org Announcements - http://lists.phillylinux.org/mailman/listinfo/plug-announce General Discussion -- http://lists.phillylinux.org/mailman/listinfo/plug
|
|