Can't read process output with cat and tailtail output of program`tail` and append in onelinerWriting to multiple files with catArrow keys with cat / readUbuntu Service with tail not startingGiving cat output to rm

Heavy condensation inside car during winter. Tried multiple things, but no results!

The lecturer supposed to grade my presentation fell asleep while I held it. Should I complain?

Draw a line in the center of a chessboard

I'm from Mumbai, India. I want to travel to Europe as a tourist but my salary is low ( €190/month)

A feasible and efficient method of fast global travel?

How to negotiate an offer if I'm not actually going to accept it

How do HK restaurants keep white scallops that they wok fry? No sear marks!

Why does Rome municipality seem to have a hard time maintaining the city?

Single word for being half in this world, half in some other spooky plane of existence

How to translate "cocotte en papier" in English?

Fewest Chess Pieces

Why does "Endgame​" have a different time travel theory?

Continuous functions taking uncountably many values countably often

What is QED about "Cavity QED"?

Is there a coup going on in Bolivia?

20 cards with no Set

In TDD, should I add unit tests to refactored code?

Does a small cup of coffee result in a 45% reduced blood flow to the brain?

Is 忍者/忍び also used for women?

How do shared hosting providers know you own a domain when you point the DNS to their server?

Why can "bubo" ("owl") be feminine or masculine?

What happens when a ceramic bypass or decoupling capacitor goes bad?

Why would a life-insurance company agree to a 20-year guaranteed life annuity which is expected to pay out more than the principal?

Expand a recursive pattern



Can't read process output with cat and tail


tail output of program`tail` and append in onelinerWriting to multiple files with catArrow keys with cat / readUbuntu Service with tail not startingGiving cat output to rm






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty
margin-bottom:0;









2

















I have a simple example of writing to stdout:



import datetime
import time


if __name__ == '__main__':

while True:
print('time is '.format(datetime.datetime.now().time()))
time.sleep(5)


Then I did:



python main.py & echo $!


to run my process and get its PID.



My purpose is reading from stdout of my current process above, but all of these commands just freeze console and don't show stdout content



sudo tail -f /proc/15608/fd/1my console
sudo cat /proc/15608/fd/1


Notice strace works perfectly:



sudo strace -e write=1 -e trace=write -p 15608


But it gives me too much useless text.



My question: why don't cat (and tail) work properly and freeze my console? Could somebody explain me why it happens?










share|improve this question


























  • This might answer some of your questions: Why can't I tail -f /proc/$pid/fd/1?

    – steeldriver
    Aug 12 at 1:36

















2

















I have a simple example of writing to stdout:



import datetime
import time


if __name__ == '__main__':

while True:
print('time is '.format(datetime.datetime.now().time()))
time.sleep(5)


Then I did:



python main.py & echo $!


to run my process and get its PID.



My purpose is reading from stdout of my current process above, but all of these commands just freeze console and don't show stdout content



sudo tail -f /proc/15608/fd/1my console
sudo cat /proc/15608/fd/1


Notice strace works perfectly:



sudo strace -e write=1 -e trace=write -p 15608


But it gives me too much useless text.



My question: why don't cat (and tail) work properly and freeze my console? Could somebody explain me why it happens?










share|improve this question


























  • This might answer some of your questions: Why can't I tail -f /proc/$pid/fd/1?

    – steeldriver
    Aug 12 at 1:36













2












2








2








I have a simple example of writing to stdout:



import datetime
import time


if __name__ == '__main__':

while True:
print('time is '.format(datetime.datetime.now().time()))
time.sleep(5)


Then I did:



python main.py & echo $!


to run my process and get its PID.



My purpose is reading from stdout of my current process above, but all of these commands just freeze console and don't show stdout content



sudo tail -f /proc/15608/fd/1my console
sudo cat /proc/15608/fd/1


Notice strace works perfectly:



sudo strace -e write=1 -e trace=write -p 15608


But it gives me too much useless text.



My question: why don't cat (and tail) work properly and freeze my console? Could somebody explain me why it happens?










share|improve this question















I have a simple example of writing to stdout:



import datetime
import time


if __name__ == '__main__':

while True:
print('time is '.format(datetime.datetime.now().time()))
time.sleep(5)


Then I did:



python main.py & echo $!


to run my process and get its PID.



My purpose is reading from stdout of my current process above, but all of these commands just freeze console and don't show stdout content



sudo tail -f /proc/15608/fd/1my console
sudo cat /proc/15608/fd/1


Notice strace works perfectly:



sudo strace -e write=1 -e trace=write -p 15608


But it gives me too much useless text.



My question: why don't cat (and tail) work properly and freeze my console? Could somebody explain me why it happens?







command-line bash






share|improve this question














share|improve this question











share|improve this question




share|improve this question










asked Aug 11 at 22:05









SergeySergey

111 bronze badge




111 bronze badge















  • This might answer some of your questions: Why can't I tail -f /proc/$pid/fd/1?

    – steeldriver
    Aug 12 at 1:36

















  • This might answer some of your questions: Why can't I tail -f /proc/$pid/fd/1?

    – steeldriver
    Aug 12 at 1:36
















This might answer some of your questions: Why can't I tail -f /proc/$pid/fd/1?

– steeldriver
Aug 12 at 1:36





This might answer some of your questions: Why can't I tail -f /proc/$pid/fd/1?

– steeldriver
Aug 12 at 1:36










0






active

oldest

votes













Your Answer








StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "89"
;
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',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/4.0/"u003ecc by-sa 4.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);














draft saved

draft discarded
















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1165053%2fcant-read-process-output-with-cat-and-tail%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown


























0






active

oldest

votes








0






active

oldest

votes









active

oldest

votes






active

oldest

votes
















draft saved

draft discarded















































Thanks for contributing an answer to Ask Ubuntu!


  • Please be sure to answer the question. Provide details and share your research!

But avoid


  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1165053%2fcant-read-process-output-with-cat-and-tail%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown









Popular posts from this blog

Tamil (spriik) Luke uk diar | Nawigatjuun

Align equal signs while including text over equalitiesAMS align: left aligned text/math plus multicolumn alignmentMultiple alignmentsAligning equations in multiple placesNumbering and aligning an equation with multiple columnsHow to align one equation with another multline equationUsing \ in environments inside the begintabularxNumber equations and preserving alignment of equal signsHow can I align equations to the left and to the right?Double equation alignment problem within align enviromentAligned within align: Why are they right-aligned?

Training a classifier when some of the features are unknownWhy does Gradient Boosting regression predict negative values when there are no negative y-values in my training set?How to improve an existing (trained) classifier?What is effect when I set up some self defined predisctor variables?Why Matlab neural network classification returns decimal values on prediction dataset?Fitting and transforming text data in training, testing, and validation setsHow to quantify the performance of the classifier (multi-class SVM) using the test data?How do I control for some patients providing multiple samples in my training data?Training and Test setTraining a convolutional neural network for image denoising in MatlabShouldn't an autoencoder with #(neurons in hidden layer) = #(neurons in input layer) be “perfect”?