• Zhang Zhen's avatar
    seltests/zram: fix syntax error · 7ef7cc9f
    Zhang Zhen authored
    Not all shells define a variable UID. This is a bash and zsh feature only.
    In other shells, the UID variable is not defined, so here test command
    expands to [ != 0 ] which is a syntax error.
    
    Without this patch:
    root@HGH1000007090:/opt/work/linux/tools/testing/selftests/zram# sh zram.sh
    zram.sh: 8: [: !=: unexpected operator
    zram.sh : No zram.ko module or /dev/zram0 device file not found
    zram.sh : CONFIG_ZRAM is not set
    
    With this patch:
    root@HGH1000007090:/opt/work/linux/tools/testing/selftests/zram# sh ./zram.sh
    zram.sh : No zram.ko module or /dev/zram0 device file not found
    zram.sh : CONFIG_ZRAM is not set
    Signed-off-by: default avatarZhang Zhen <zhenzhang.zhang@huawei.com>
    Signed-off-by: default avatarShuah Khan <shuahkh@osg.samsung.com>
    7ef7cc9f
zram_lib.sh 4.82 KB