Problem:
I’m unsure if this behavior is a problem, but I want to describe my experiment.
I wrote a small bash script.
#!/bin/bash
hammer task progress --id 3398cfbc-ac3a-487b-bcab-79b803afc711 &> ./stdout_and_stderr_log.txt
hammer task progress --id 3398cfbc-ac3a-487b-bcab-79b803afc711 1> ./stdout_log.txt
hammer task progress --id 3398cfbc-ac3a-487b-bcab-79b803afc711 2> ./stderr_log.txt
Then, I checked the content of files.
stdout_and_stderr_log.txt:
cat stdout_and_stderr_log.txt
Task 3398cfbc-ac3a-487b-bcab-79b803afc711 success: 1.0/1, 100%, elapsed: 00:00:00
Task 3398cfbc-ac3a-487b-bcab-79b803afc711 success: 1.0/1, 100%, elapsed: 00:00:00
stdout_log.txt:
empty file
stderr_log.txt:
cat stderr_log.txt
[...............................................................................................................................] [100%]
Correct me if I am wrong, but here are Linux redirection rules:
1> file redirects stdout to file
2> file redirects stderr to file
&> file redirects stdout and stderr to file
Why stdout_log.txt is empty?
I would expect something like
Task 3398cfbc-ac3a-487b-bcab-79b803afc711 success: 1.0/1, 100%, elapsed: 00:00:00
Why stderr_log.txt show % of task status?
I would expect an empty file
How is it possible that &> returns a double line?
I would expect just a line:
Task 3398cfbc-ac3a-487b-bcab-79b803afc711 success: 1.0/1, 100%, elapsed: 00:00:00