Answer the question
In order to leave comments, you need to log in
How to write the error stream and return code from one command to variables without using a file?
Let's say that we have a blabla command , and two variables ERROR and KOD
The value of the exit code ($?) of our command (blabla) should always fall into the KOD variable.
If the command (blabla) worked successfully, output the result to the console (&1), in case of failure, write the stream of errors (&2) to the ERROR variable without displaying it.
How can this be done without writing to a file?
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question