• ltp-ddt lmbench


    ltp-ddt lmbench


    args=''

    # getopt fails, set help option
    if [ $? -ne 0 ] ; then
            H="help";
    fi

    # update the refined command line argumetn list
    eval set -- $args

    # parse the command line argument and update the shell variables
    # so that functions above can use them

    for i in $@ ; do
    case "$i" in

            -h) shift; H="help" ;;
            --help) shift; H="help" ;;
    esac
    done


    # update the refined command line argumetn list once more
    eval set -- $args

    # call appropriate functions
    if [ "$H" = "help" ] ;  then
            $H
    else
            lmbench_tests
            print_summary
        if [ $FAIL_COUNT > 0 ]; then
                exit $FAIL_COUNT
        else
                exit 0
        fi
    fi

    ./runltp -P fmxx-psoc-db -f ddt/lmbench

    在runtest/ddt/lmbench中将
    # @name LMBENCH_TESTS
    # @desc Run all LMBENCH tests
    # @requires armv*

    LMBENCH_L_PERF_0001 lmbench_tests_script.sh
    改为
    # @name LMBENCH_TESTS
    # @desc Run all LMBENCH tests
    # @requires armv*

    LMBENCH_L_PERF_0001 lmbench_tests_script.sh -h

    发现运行后并没有运行help
    sh -x 单独运行 lmbench_tests_script.sh -h
    发现eval set -- $args 这句有嫌疑

    见一段code
    test.sh
    #!/bin/sh
    set -- a b c
    echo "$1=$1"
    echo "$2=$2"
    echo "$3=$3"

    test.sh
    输出
    $1=a
    $2=b
    $3=c

    test.sh 1 2 3
    输出
    $1=a
    $2=b
    $3=c

    所以set -- 就是用后面的参数覆盖原位置的参数

    eval set -- $args == eval set -- '',h就被覆盖了


  • 相关阅读:
    4.23Java自定义链表最终封装与完善
    4.23Java vector向量
    托管与非托管
    关于C#中的DLLImport (引)
    C#中通过DllImport使用 Win32 API(引)
    ASP.Net HttpHandler (转)
    C#WinForm获取本机网卡的型号,IP地址,子网掩码和网关
    ManagementObject
    asp.net Session详解(再转)
    C#优化字符串操作(引)
  • 原文地址:https://www.cnblogs.com/idyllcheung/p/10867550.html
Copyright © 2020-2023  润新知