Changeset 2551


Ignore:
Timestamp:
Jul 16, 2008, 11:03:37 PM (12 years ago)
Author:
Sam Hocevar
Message:
  • check-utils: use tail -n X or tail -X depending on the platform.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • zzuf/trunk/test/check-utils

    r2550 r2551  
    4040            # initially. (Linux sed doesn't, but OS X sed does.)
    4141            check "$ZZOPTS" "head -n 9999 $file" "head -n 9999"
    42             check "$ZZOPTS" "tail -n 9999 $file" "tail -n 9999"
    43             check "$ZZOPTS" "tail -n +1 $file" "tail -n +1"
     42            check "$ZZOPTS" "${TAILN}9999 $file" "${TAILN}9999"
     43            check "$ZZOPTS" "${TAILP}1 $file" "${TAILP}1"
    4444            if grep -a '' /dev/null >/dev/null 2>&1; then
    4545                check "$ZZOPTS" "grep -a '' $file" "grep -a ''"
     
    4848            #check "$ZZOPTS" "cut -b1- $file" "cut -b1-"
    4949            check "$ZZOPTS" "-i head -n 9999 < $file" "|head -n 9999"
    50             check "$ZZOPTS" "-i tail -n 9999 < $file" "|tail -n 9999"
    51             check "$ZZOPTS" "-i tail -n +1 < $file" "|tail -n +1"
     50            check "$ZZOPTS" "-i ${TAILN}9999 < $file" "|${TAILN}9999"
     51            check "$ZZOPTS" "-i ${TAILP}1 < $file" "|${TAILP}1"
    5252            if grep -a '' /dev/null >/dev/null 2>&1; then
    5353                check "$ZZOPTS" "-i grep -a '' < $file" "|grep -a ''"
     
    9898  STATIC_DD=1
    9999fi
     100if tail -n 1 /dev/null >/dev/null 2>&1; then
     101  TAILN="tail -n "
     102  TAILP="tail -n +"
     103else
     104  TAILN="tail -"
     105  TAILP="tail +"
     106fi
    100107FAILED=0
    101108TESTED=0
Note: See TracChangeset for help on using the changeset viewer.