Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [pipe]

Pipes or named pipes are a feature of the POSIX standard that allow separate processes to communicate with each other without having been designed explicitly to work together.

0
votes
1answer
63 views

How can I use a “here document” in the middle of a pipe?

I am wanting to generate some content using a heredoc as a template: passphrase=$(<passphrase) envsubst <<EOF apiVersion: v1 kind: Secret metadata: name: openshift-passphrase stringData: ...
3
votes
2answers
261 views

How can I redirect output from stdout into vim? [duplicate]

I would like to view the output of echo in vim, and save to a file after having a look at it. I have tried echo $PATH | vim, but I get the following error: Vim: Warning: Input is not from a terminal ...
0
votes
2answers
65 views

How to pipe output of command to another command while also displaying it on the console?

I want to write part of the results of a stream to a file, but I want the entire contents of the stream printed to the console. Is there some command that would help with this? Minimal example: Say ...
0
votes
1answer
33 views

Pipeline after sourcing a bashscript

I have a code # Inside Child.sh ChildVariable=BigChild # Inside Parent.sh source ./Child.sh echo "ChildVariable=${ChildVariable}" Output: ChildVariable=BigChild But, # Inside Parent.sh source ....
0
votes
1answer
57 views

Skip N bytes every M bytes while reading from named pipe

I pipe data from one process to another, but this stream needs to be filtered. The first process is ffmpeg and the second is ffplay. ffmpeg provides raw video frame for fplay to render, however it ...
2
votes
0answers
680 views

In-place delta writes from a pipe

I'm looking for a way to only overwrites the parts of a file that differ from what's supposed to be written to it, so that the file is changed with the least amount of writes to disk possible. My ...
0
votes
1answer
29 views

Named pipe for inter-process communication [closed]

I want to use a named pipe for communication between a PHP server-script and a service, i.e. a process (a Python script) listening on the other end of the pipe. This service runs intentionally under a ...
0
votes
1answer
48 views

Pass cronjob output as parameter to curl

I have cronjob that takes hourly backup. Now I want to pass any stderr to an API. 0 * * * * /usr/local/sbin/script.sh 2>&1 | curl -k -X GET "https://192.168.0.25/path/of/joomla/instance/index....
0
votes
0answers
16 views

Log watching in less

Let there be a log file, call it /var/log/example. As usual, a service continuously outputs lines to that file. I want to watch this file's contents in real time using less (or equivalent). I am ...
1
vote
2answers
36 views

Use vim in pipeline to dump current line on exit to stdout?

Is it possible for me to do something like this: $ ls | vim | xargs ... and have vim pass to stdout any lines that were visually selected on exit? If it'd be easier to just dump the "current line" ...
2
votes
2answers
147 views

GNU “parallel --pipe” doesn't process stdin by lines

I'm super confused about how to use GNU parallel to pass stdin to the job command. I have what I imagined to be a really common use case. I have some process xxd that does something with stdin and ...
0
votes
1answer
414 views

using xargs pass arguments to sub shell with pipe

I want to rename a number of files. I think I can use xargs to do it. find ./ -name "upload.log-*" ./upload.log-20180622.gz-20180624.gz-20180626.gz ./upload.log-20180624.gz-20180626.gz ./upload.log-...
2
votes
1answer
47 views

Duplicating stderr output and merge with stderr in bash without changing order

I want to write both stderr and stdout to a log file, and print stderr to the terminal (or default output device). Motivation: I have a command in my crontab, and I want to log all of its output to a ...
2
votes
1answer
388 views

How to concatenate two lines with `sed`?

I am trying to concatenate two lines of iwlist output. My grep and sed commands to remove leading and trailing spaces work fine but I can't get the last sed statement to remove the \n to work. What am ...
1
vote
1answer
141 views

Using > and < inside a batch file, with a for loop

When doing this inside a test.bat file: for %%i in (__src\*.js) do jsmin <"%%i" >"temp\%%~ni%%~xi" "(C) Example" I was expecting to see: D:\Temp>jsmin <"__src\background.js" >"temp\...
1
vote
2answers
61 views

Linux bash - how to run a list of binary files that is generated from another script?

I have a script that generates list of binary files to be executed: \home\joe\bin\script1 \home\joe\bin\script2 \home\joe\bin\script3 .. Question 1: How can I run all of these files one by one from ...
3
votes
2answers
8k views

Get response body and show HTTP code by curl

I have endpoint which returns JSON (response body). I need get by curl the response body and process it (for example using jq). It works: response=$(curl -s https://swapi.co/api/people/1/?format=json)...
1
vote
1answer
26 views

How can I use the Linux terminal to pipe only parts of program input concatenated with hard strings?

I understand that I can use xargs like this: echo "-i inputfile.raw -o outputfile.jpg" | xargs -t ./myprogram However, I am fuzz-testing the application and I have a fuzzer which works like this: ...
0
votes
1answer
119 views

How to add a custom parser for a file type into MC viewer?

When you press F3 on a .sqlite file in midnight commander the Viewer shows the SQL dump of the file instead of the original binary, and F8 can be used to switch between parsed and raw modes. This ...
4
votes
2answers
891 views

Testing grep exit status with pipe and variable unsuccessful

I need as short as possible bash test command (bracket test) to evaluate result of piped grep with variable as search argument. I am testing, whether a new string is in the array - piping the array ...
1
vote
2answers
102 views

Pipe output from program to a dynamic named file (contains date)

I am still a bottle feeding linux newbie, so go easy. I've googled myself this far but can't find the answer. I'm running a program that outputs csv data, and piping it to log.csv I'm looking for a ...
2
votes
0answers
64 views

Can a Win10 GURU automate this solution for splitting videos upon resolution changes? [duplicate]

Can a Windows10 Guru help automate this? I have failed at automating Lord Neckbeard's solution in the following post: How to split video files upon detected change in resolution? (ie. recorded ...
1
vote
1answer
167 views

Command line: How to handle spaces in filenames

I am measuring the total sizes of a bunch of files, whose paths I have stored in a text document, files.txt. Example contents of files.txt: file1.txt file2.txt file3.txt This shell command gives me ...
0
votes
0answers
22 views

WALL into vi / emacs?

How would I WALL a program template into vi or emacs? Tried this with no luck: wall vi template.C cat template.C | wall wall :wq Note: template.C contains a template for C++ code, i.e. include ...
1
vote
0answers
59 views

Proper permissions for postfix piped script

As my almost-alliterative title states, I am attempting to configure postfix to pipe incoming messages to a PHP script. As it currently stands, postfix apparently attempts to run the script as the '...
0
votes
2answers
351 views

How to pipe input to Wireshark in Windows Power Shell?

I am trying to run the following command in Power Shell: C:\Users\mne\Desktop\plink.exe -ssh -pw abc root@myhost "tcpdump -w - -U -i vethf90673c 'port 5000'" | &"C:\Program Files\Wireshark\...
1
vote
1answer
627 views

Reverse shell using netcat on windows (no -e option)

Is there any way to get a reverse shell in Windows using netcat without using -e option since it triggers UAC? I made it work from Linux to Linux by using a named pipe. I wanted to achieve something ...
-1
votes
1answer
54 views

How to reverse piping properly?

I try to do reverse piping. More precisely, I try to reverse this statement: echo 'user:passwd' | sudo chpasswd I would like to get the 'sudo chpasswd' upfront. I tried both this: sudo chpasswd ...
1
vote
3answers
1k views

Writing to a file from a udev RUN command

I am working on creating a udev ruleset that writes to a log file each time a certain USB drive is inserted. My ruleset, stored in /etc/udev/rules.d /99-log-USB-drive.rules, currently contains the ...
0
votes
0answers
172 views

pipe a list of files to lrztar or lrzip

I know you can pipe the output of a ``find" command to tar, and then that file to lrzip, but I also know that will reduce the compression efficiency. I tried find . -name "*.tex" |lrztar -n -o find....
0
votes
1answer
124 views

Break down the following bash script?

I need help breaking down the following bash script, to understand what the author was trying to do. The script is meant to search a log file for data and then compare it to an email log file. ...
-1
votes
1answer
97 views

Mercurial collapses lines into single line when piping output

I'd like to sort based on the output of a mercurial (hg) command. The output from hg log is collapsed into 1 line when piping to another command but I want to keep separate lines. Here's a minimum ...
1
vote
1answer
59 views

Piping StdOut adds more text

I am running a simple command (some Kafka related stuff): curl localhost:8083 Its output is very simple: root@debian:/etc/kafka# curl localhost:8083/ {"version":"0.11.0.0-cp1","commit":"...
0
votes
1answer
334 views

How to “tail” multiple pipe files or streams?

I need to monitor a lot of web servers for runtime errors and I have an idea of running a script like #!/bin/bash -e # Example set of hosts HOSTS=( host1 host2 ) for host in ${HOSTS[@]} do [...
1
vote
1answer
137 views

What does this do? `Find … -type d|xargs chmod 770`

What does these two lines do? find /backup/folder -type d|xargs chmod 770 find /backup/folder -type f|xargs chmod 660 I googled around, but can't figure out what d|xargs and f|xargs does.
5
votes
3answers
540 views

Coerce scp(1), sftp(1), or rsync(1) into transferring a named pipe

I intend to transfer full and incremental backups of my btrfs subvolumes to a tape archival service. The service exposes FTP and SSH endpoints. If I were allowed to execute arbitrary commands on the ...
3
votes
1answer
789 views

Proper, if any, way to use dd as pipe buffer?

The Question When I looked for pipe buffering tools in *NIX, I see suggestions of using buffer, mbuffer, or pv. However, the former two are not always in distros' official repo (such as Arch), while ...
0
votes
1answer
42 views

How do I write a stream to a pipe on a remote machine

The below command works for file. But I see it doesn't work for a pipe echo 'Some Text' | ssh user@remotehost "cat > /remotefile.txt" I need to do tail -f of a pipe and want it to be written to ...
3
votes
1answer
307 views

Piping with Process substitution and joining output again

I'm trying to make use of a powerful remote server in terms of video encoding. I have a local DVD drive for ripping DVD to memory, finally residing in an mbuffer. From there, I would like to split ...
1
vote
1answer
133 views

echo stdin, unless empty, in which case cat a file

The pipeline fstdraw in.fst | dot -Tpng | convert - -rotate 90 out.png converts a file in a certain binary format into a PNG image. Unfortunately, in some cases fstdraw emits zero bytes. (A bug in ...
0
votes
1answer
1k views

sending mail from command line: Null message body

I'm somehow unable to get my head around this. I am sending mails from commandline with help of a little script. But the line echo 'LOREM IPSUM' | mail -s 'SUBJECT' -a 'From:TEST' < /root/...
1
vote
2answers
634 views

Piped xargs doesn't execute the command

I want to monitor nginx access.log for malformed requests and notify myself about such cases. To do this i have written following command: tail -n0 -f access.log | grep --line-buffered '\{' | ...
6
votes
1answer
3k views

filter outputs using select-string pipes

In bash, if I do the following, I will get all the environment variables with wd in them. env | grep "wd" Now, in Powershell, I know I could do get-childitem env:wd* But I want to pipe to select-...
2
votes
3answers
891 views

Windows command line - pipe output of dir search to (truncate) operation

This is Windows 10. The question is very simple, I simply don't know the proper syntax to do this. This will list all files ending in .log: dir /s /p *.log This will truncate a file: echo|set /p=&...
1
vote
0answers
144 views

How to stream files to FFmpeg?

I am trying to create a video (MP4) from a bunch of images (JPEG). I am using FFmpeg for that. I know that I can pipe the contents of the images if they’re on the same server: cat *.jpg | ffmpeg -f ...
0
votes
1answer
944 views

How to record or export the CACA output in FFMPEG?

I'm trying to export (pipe) the output device CACA in FFMPEG whithout sucsess. The script work's fine, but no OUTPUT is recorded. ffmpeg -i final3.mp4 -pix_fmt rgb24 -color fullgray -window_size ...
3
votes
3answers
3k views

Xargs pass input to command that contains a pipe

As a vehicle to understand how to manipulate binding precedence with pipes, I'm trying to print the path of one file per directory - for every directory: find $PWD -type d | xargs --delimiter "\n" -I%...
1
vote
0answers
939 views

FFMPEG receive stream from pipe via netcat fails

I am trying to receive a stream via netcat and pipe it to FFMPEG and then output to a file, but I am getting an error. The most basic command I tried was: $ nc -l -p 1935 | ffmpeg -v debug -y -f ...
0
votes
0answers
82 views

ffmpeg piping to aucdtect in a batch file

I am trying to pipe ffmpeg output to auCDtect in a batch file like this: ffmpeg -i %1 -acodec pcm_s16le -f wav - ^| auCDtect.exe -- For some reason aucdtect just freeze at Data analysis: [...
0
votes
2answers
285 views

Bash Sed Pipe to Command One-Liner

I'm trying to dump output from all of my interfaces. This is what I've got so far: ifconfig | awk '{print $1}' | sed s'/.$//' I'd like to have something like : ifconfig | awk '{print $1}' | sed s'/....