使用 bash 我试图查询/etc/passwd任何 id 超过 1000 的用户。如果他们存在,做一些事情,否则做其他事情。我难住了。任何帮助表示赞赏。
/etc/passwd
if [ "$(id -u)" -gt "1000" </etc/passwd]; then do something else do something else fi
bash users text-processing etc passwd
bash ×1
etc ×1
passwd ×1
text-processing ×1
users ×1