How is Paramiko segregating output and error message?

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
0
down vote

favorite












If I execute jdksjdkd in terminal from one machine to another machine using paramiko I am getting stderr.readlines() as Command not found.







share|improve this question





















  • That "command not found" is usually printed by the shell to its stderr. That's probably how.
    – muru
    Jun 27 at 6:40














up vote
0
down vote

favorite












If I execute jdksjdkd in terminal from one machine to another machine using paramiko I am getting stderr.readlines() as Command not found.







share|improve this question





















  • That "command not found" is usually printed by the shell to its stderr. That's probably how.
    – muru
    Jun 27 at 6:40












up vote
0
down vote

favorite









up vote
0
down vote

favorite











If I execute jdksjdkd in terminal from one machine to another machine using paramiko I am getting stderr.readlines() as Command not found.







share|improve this question













If I execute jdksjdkd in terminal from one machine to another machine using paramiko I am getting stderr.readlines() as Command not found.









share|improve this question












share|improve this question




share|improve this question








edited Jun 27 at 11:13









Anthony Geoghegan

7,14233651




7,14233651









asked Jun 27 at 5:55









Abdulvakaf K

294




294











  • That "command not found" is usually printed by the shell to its stderr. That's probably how.
    – muru
    Jun 27 at 6:40
















  • That "command not found" is usually printed by the shell to its stderr. That's probably how.
    – muru
    Jun 27 at 6:40















That "command not found" is usually printed by the shell to its stderr. That's probably how.
– muru
Jun 27 at 6:40




That "command not found" is usually printed by the shell to its stderr. That's probably how.
– muru
Jun 27 at 6:40










1 Answer
1






active

oldest

votes

















up vote
2
down vote













The PATH environment variable indicates that where the commands resides.
So in your case , since "jdksjkdk" is not found in the $PATH , it throws error on STDERR file descriptor and hence you are getting stderr.readiness() as Command not found





Explanation: There are 3 standard file descriptors, every running program in linux opens the following file descriptors



  1. STDIN (0) => for standard input

  2. STDOUT(1) => for standard output

  3. STDERR (2) => for standard error



So when the command was not found, the error was written to STDERR (
file desciptor => 2 ) , if it was successful, then output would had
been written to STDOUT ( file descriptor => 1 ) . Since paramiko is
reading result from STDERR and not STDOUT , this is how it is
verifying it is error not output







share|improve this answer





















  • I believed the above statement. but in one of my case I am getting stdout(output) as stderr message. The data got swapped between this two. So that I raised this question.
    – Abdulvakaf K
    Jun 27 at 6:31










  • Maybe then it must be checking the return status of your process to check if it failed or not
    – Arushix
    Jun 27 at 6:35










Your Answer







StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "106"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
convertImagesToLinks: false,
noModals: false,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);








 

draft saved


draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f452145%2fhow-is-paramiko-segregating-output-and-error-message%23new-answer', 'question_page');

);

Post as a guest






























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes








up vote
2
down vote













The PATH environment variable indicates that where the commands resides.
So in your case , since "jdksjkdk" is not found in the $PATH , it throws error on STDERR file descriptor and hence you are getting stderr.readiness() as Command not found





Explanation: There are 3 standard file descriptors, every running program in linux opens the following file descriptors



  1. STDIN (0) => for standard input

  2. STDOUT(1) => for standard output

  3. STDERR (2) => for standard error



So when the command was not found, the error was written to STDERR (
file desciptor => 2 ) , if it was successful, then output would had
been written to STDOUT ( file descriptor => 1 ) . Since paramiko is
reading result from STDERR and not STDOUT , this is how it is
verifying it is error not output







share|improve this answer





















  • I believed the above statement. but in one of my case I am getting stdout(output) as stderr message. The data got swapped between this two. So that I raised this question.
    – Abdulvakaf K
    Jun 27 at 6:31










  • Maybe then it must be checking the return status of your process to check if it failed or not
    – Arushix
    Jun 27 at 6:35














up vote
2
down vote













The PATH environment variable indicates that where the commands resides.
So in your case , since "jdksjkdk" is not found in the $PATH , it throws error on STDERR file descriptor and hence you are getting stderr.readiness() as Command not found





Explanation: There are 3 standard file descriptors, every running program in linux opens the following file descriptors



  1. STDIN (0) => for standard input

  2. STDOUT(1) => for standard output

  3. STDERR (2) => for standard error



So when the command was not found, the error was written to STDERR (
file desciptor => 2 ) , if it was successful, then output would had
been written to STDOUT ( file descriptor => 1 ) . Since paramiko is
reading result from STDERR and not STDOUT , this is how it is
verifying it is error not output







share|improve this answer





















  • I believed the above statement. but in one of my case I am getting stdout(output) as stderr message. The data got swapped between this two. So that I raised this question.
    – Abdulvakaf K
    Jun 27 at 6:31










  • Maybe then it must be checking the return status of your process to check if it failed or not
    – Arushix
    Jun 27 at 6:35












up vote
2
down vote










up vote
2
down vote









The PATH environment variable indicates that where the commands resides.
So in your case , since "jdksjkdk" is not found in the $PATH , it throws error on STDERR file descriptor and hence you are getting stderr.readiness() as Command not found





Explanation: There are 3 standard file descriptors, every running program in linux opens the following file descriptors



  1. STDIN (0) => for standard input

  2. STDOUT(1) => for standard output

  3. STDERR (2) => for standard error



So when the command was not found, the error was written to STDERR (
file desciptor => 2 ) , if it was successful, then output would had
been written to STDOUT ( file descriptor => 1 ) . Since paramiko is
reading result from STDERR and not STDOUT , this is how it is
verifying it is error not output







share|improve this answer













The PATH environment variable indicates that where the commands resides.
So in your case , since "jdksjkdk" is not found in the $PATH , it throws error on STDERR file descriptor and hence you are getting stderr.readiness() as Command not found





Explanation: There are 3 standard file descriptors, every running program in linux opens the following file descriptors



  1. STDIN (0) => for standard input

  2. STDOUT(1) => for standard output

  3. STDERR (2) => for standard error



So when the command was not found, the error was written to STDERR (
file desciptor => 2 ) , if it was successful, then output would had
been written to STDOUT ( file descriptor => 1 ) . Since paramiko is
reading result from STDERR and not STDOUT , this is how it is
verifying it is error not output








share|improve this answer













share|improve this answer



share|improve this answer











answered Jun 27 at 6:21









Arushix

9968




9968











  • I believed the above statement. but in one of my case I am getting stdout(output) as stderr message. The data got swapped between this two. So that I raised this question.
    – Abdulvakaf K
    Jun 27 at 6:31










  • Maybe then it must be checking the return status of your process to check if it failed or not
    – Arushix
    Jun 27 at 6:35
















  • I believed the above statement. but in one of my case I am getting stdout(output) as stderr message. The data got swapped between this two. So that I raised this question.
    – Abdulvakaf K
    Jun 27 at 6:31










  • Maybe then it must be checking the return status of your process to check if it failed or not
    – Arushix
    Jun 27 at 6:35















I believed the above statement. but in one of my case I am getting stdout(output) as stderr message. The data got swapped between this two. So that I raised this question.
– Abdulvakaf K
Jun 27 at 6:31




I believed the above statement. but in one of my case I am getting stdout(output) as stderr message. The data got swapped between this two. So that I raised this question.
– Abdulvakaf K
Jun 27 at 6:31












Maybe then it must be checking the return status of your process to check if it failed or not
– Arushix
Jun 27 at 6:35




Maybe then it must be checking the return status of your process to check if it failed or not
– Arushix
Jun 27 at 6:35












 

draft saved


draft discarded


























 


draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f452145%2fhow-is-paramiko-segregating-output-and-error-message%23new-answer', 'question_page');

);

Post as a guest













































































Popular posts from this blog

How to check contact read email or not when send email to Individual?

Displaying single band from multi-band raster using QGIS

How many registers does an x86_64 CPU actually have?