📄 help-version
字号:
#! /bin/sh# Make sure all these programs work properly# when invoked with --help or --version.test "$VERBOSE" = yes && set -xexpected_failure_status_date=2expected_failure_status_printenv=2expected_failure_status_tty=3expected_failure_status_sort=2case "$all_programs" in *nohup*) if test -w /dev/full && test -c /dev/full && echo > /dev/full; then cat 1>&2 <<\EOF************************************************WARNING: On this system, the built-in echo function of /bin/shdoes not report failure when writing to a full device.To demonstrate, run this command: /bin/sh -c 'echo hello > /dev/full; echo status=$?'Notice that the failing echo leaves its exit status set to zeroand does not produce a diagnostic.That bug in /bin/sh would cause the tests of the nohup and groupsscripts to fail, so those two are being removed from the list ofprograms checked by this test.************************************************EOF all_programs=`echo $all_programs|sed 's/\<nohup\> *//;s/\<groups\> *//'` fi ;;esacfail=0for lang in C fr da; do for i in $all_programs; do # false fails even when invoked with --help or --version. if test $i = false; then env LC_MESSAGES=$lang ./$i --help >/dev/null && fail=1 env LC_MESSAGES=$lang ./$i --version >/dev/null && fail=1 continue fi # The just-built install executable is always named `ginstall'. test $i = install && i=ginstall # Make sure they exit successfully, under normal conditions. ./$i --help >/dev/null || fail=1 ./$i --version >/dev/null || fail=1 # Make sure they fail upon `disk full' error. if test -w /dev/full && test -c /dev/full; then ./$i --help >/dev/full 2>/dev/null && fail=1 ./$i --version >/dev/full 2>/dev/null && fail=1 status=$? eval "expected=\$expected_failure_status_$i" test x$expected = x && expected=1 if test $status = $expected; then : # ok else fail=1 echo "$i with --help and/or --version didn't fail with output" \ "redirected to /dev/full" 1>&2 fi fi donedonetmp=tmp-$$tmp_in=in-$$tmp_in2=in2-$$tmp_dir=dir-$$tmp_out=out-$$mkdir $tmp || fail=1cd $tmp || fail=1comm_args="$tmp_in $tmp_in"csplit_args="$tmp_in //"cut_args='-f 1'join_args="$tmp_in $tmp_in"tr_args='a a'chmod_args="a+x $tmp_in"# Punt on these.chgrp_args=--versionchown_args=--versionmkfifo_args=--versionmknod_args=--versioncmp_args="$tmp_in $tmp_in2"diff_args="$tmp_in $tmp_in2"sdiff_args="$tmp_in $tmp_in2"diff3_args="$tmp_in $tmp_in2 $tmp_in2"cp_args="$tmp_in $tmp_in2"ln_args="$tmp_in $tmp_in2"ginstall_args="$tmp_in $tmp_in2"mv_args="$tmp_in $tmp_in2"mkdir_args=$tmp_in2rmdir_args=$tmp_dirrm_args=$tmp_inshred_args=$tmp_intouch_args=$tmp_in2basename_args=$tmp_indirname_args=$tmp_inexpr_args=foo# Punt, in case GNU `id' hasn't been installed yet.groups_args=--versionpathchk_args=$tmp_inyes_args=--versionlogname_args=--versionnohup_args=--versionprintf_args=fooseq_args=10sleep_args=0su_args=--versiontest_args=foo# skip chroot, stty, tty, falsefor i in $all_programs; do # Skip these. case $i in chroot|stty|tty|false) continue;; esac rm -rf $tmp_in $tmp_in2 $tmp_dir $tmp_out echo > $tmp_in echo > $tmp_in2 mkdir $tmp_dir # echo ================== $i eval "args=\$${i}_args" if ../$i $args < $tmp_in > $tmp_out; then : # ok else echo FAIL: $i fail=1 fi rm -rf $tmp_in $tmp_in2 $tmp_out $tmp_dirdone# FIXME: trapcd ..rm -rf $tmpexit $fail
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -