1
我想将输出重定向到stderr。我有一个cron作业将输出重定向到stderr
function auth_tester {
cd /data/$1/current && bundle exec rake 'authentication:tester' 1> /dev/null
}
它调用rake任务
namespace :authentication do
desc "Automatically runs authentication tester and notifies in case of failure"
task :tester => :environment do
auth_tester_results = AuthenticationTester.perform
exit(auth_tester_results.success? ? 0 : 1)
end
end
如果“auth_tester_results”布尔是假的我想将输出重定向到stderr。如何做呢?
我的问题是如何将重定向我的失败输出到stderr。您的回答对于如何将stderr重定向到stdout也很有帮助。但请回答如何将我的故障输出重定向到stderr – krishna
请参阅更新。 – mudasobwa