1
sed -e '$!d'が期待どおりに機能しませんか?
私が走ると: sudo /usr/local/nginx/sbin/nginx -t 私は戻ります: nginx: the configuration file /usr/local/nginx/conf/nginx.conf syntax is ok nginx: configuration file /usr/local/nginx/conf/nginx.conf test is successful 最後の行が欲しいので実行します: sudo /usr/local/nginx/sbin/nginx -t | sed -e '$!d' しかし、sedを使用しない場合と同じように戻ります。