尝试运行脚本时 Sigstop?

尝试运行脚本时 Sigstop?

我试图列出用户的所有命令,不幸的是我遇到了一个奇怪的 sigstop,我不知道如何诊断?

#!/bin/ksh
echo '['
for USER in `cut -d: -f1 /etc/passwd |sed '/^#/ d'`; do
    if ! su $USER 2>&1 |grep 'unknown login'; then 
        echo "  {"
        echo "    USER: '$USER',"
        echo "    CMDS: '$(su $USER -c 'sudo -l')'"
        echo "  },"
    fi
done
echo ']'

错误

# ./sudoers.ksh
[
  {
    USER: 'nobody',
    CMDS: ''
  },
./sudoers.ksh: line 8: 27013: Stopped (SIGSTOP)

相关内容