Skip to content

Magenaut

  • Home
  • Topics
    • Notes
    • Tutorial
    • Bug fixing
    • Extension
    • Server
  • Q&A
  • Privacy Policy
  • About

pipe

How to pipe input to python line by line from linux program?

August 15, 2022 by Magenaut

I want to pipe the output of ps -ef to python line by line.

Categories Python, Q&A Tags pipe, python Leave a comment

Multiprocessing – Pipe vs Queue

August 15, 2022 by Magenaut

What are the fundamental differences between queues and pipes in Python’s multiprocessing package?

Categories Python, Q&A Tags multiprocessing, performance, pipe, python, queue Leave a comment

Checking for interactive shell in a Python script

August 13, 2022 by Magenaut

I need to determine whether the shell which invoked my Python script was in interactive mode or not. If it was in interactive mode, the program should pipe output to less(1) for easy reading. If not, it should simply print its output to stdout, to allow it to be piped away to a printer, file, or a different pager.

Categories Python, Q&A Tags interactive, pipe, python, shell Leave a comment

Communicate multiple times with a process without breaking the pipe?

August 12, 2022 by Magenaut

It’s not the first time I’m having this problem, and it’s really bugging me.
Whenever I open a pipe using the Python subprocess module, I can only communicate with it once, as the documentation specifies: Read data from stdout and stderr, until end-of-file is reached

Categories Python, Q&A Tags pipe, python, subprocess Leave a comment

Should I care about unnecessary cats?

August 11, 2022 by Magenaut

A lot of command-line utilities can take their input either from a pipe or as a filename argument. For long shell scripts, I find starting the chain off with a cat makes it more readable, especially if the first command would need multi-line arguments.

Categories Q&A, Unix & Linux Tags cat, performance, pipe, shell-script Leave a comment

What is the portable (POSIX) way to achieve process substitution?

August 11, 2022 by Magenaut

Some shells, like bash, support Process Substitution which is a way to present process output as a file, like this:

Categories Q&A, Unix & Linux Tags pipe, posix, process-substitution, shell Leave a comment

zsh I/O redirection: redirecting and then piping; what is going on?

August 11, 2022 by Magenaut

Can somebody explain what is going on in this command:

Categories Q&A, Unix & Linux Tags io-redirection, pipe, zsh Leave a comment

Why does the command shuf file > file leave an empty file, but similar commands do not?

August 11, 2022 by Magenaut

3.1.1 Shell Operation

Categories Q&A, Unix & Linux Tags io-redirection, pipe, shell Leave a comment

Using data read from a pipe instead than from a file in command options

August 11, 2022 by Magenaut

Per man definition, this command gets the input from a file.

Categories Q&A, Unix & Linux Tags bash, pipe Leave a comment

Why does process substitution result in a file called /dev/fd/63 which is a pipe?

August 11, 2022 by Magenaut

I am trying to understand named pipes in the context of this particular example.

Categories Q&A, Unix & Linux Tags open-files, pipe, process, process-substitution Leave a comment
Older posts
Newer posts
← Previous Page1 Page2 Page3 … Page9 Next →
  1. michealSmith07 on Is there a way to dynamically refresh the less command?August 21, 2022

    That is a very nice post. I like this post.

  2. anonymous on Fix libwacom9 dependency issue when upgrade DebianJune 27, 2022

    saved my day!! Thanks for the help…

  3. sreedhar on Fix libwacom9 dependency issue when upgrade DebianMay 10, 2022

    Thanks its working

  4. saintnick on Fix libwacom9 dependency issue when upgrade DebianMay 10, 2022

    remove libwacom2 worked for me as well

  5. ranafoul on Fix libwacom9 dependency issue when upgrade DebianApril 22, 2022

    apt remove libwacom2 helped on kali 2022.01. gr8

.net ajax asp.net asp.net-core asp.net-mvc asp.net-mvc-3 asp.net-mvc-4 asp.net-web-api bash c# command-line css custom-post-types custom-taxonomy dataframe dictionary django entity-framework functions gridview html iis javascript jquery json linux list matplotlib numpy pandas php plugin-development plugins posts python python-2.7 python-3.x security shell shell-script sql string vb.net webforms wp-query

© 2026 Magenaut • Built with GeneratePress