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
Join us in building a kind, collaborative learning community via our updated Code of Conduct.

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
0answers
11 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 ...
0
votes
1answer
20 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
93 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
46 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
32 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
180 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
66 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
41 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 ...
0
votes
2answers
2k 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
25 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
64 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
520 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
69 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
127 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
17 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
50 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
291 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
344 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
766 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
133 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
117 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
86 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
57 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
0answers
295 views

ffmpeg repeats output to stdout

I am using ffmpeg to create some m3u8 (hls) video. When I am saving segment_list to file everything works as expected, but when I am trying to write it to pipe it repeats whole playlist after ...
0
votes
1answer
262 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
124 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
467 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
550 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
233 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
102 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
828 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
428 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
2k 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
603 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
140 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
769 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 ...
2
votes
3answers
2k 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
849 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
63 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
223 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'/....
0
votes
1answer
133 views

Inplace modification of incron monitored files

I have samba share where users create video files, i need to stripe audio tracks from that video files and rsync new files to remote folder. I monitor the samba share with CLOSE_WRITE option, to strip ...
1
vote
0answers
44 views

Linux filter which convert data coming from pipe to chunked transfer encoding

I usually use Open3.popen3 in my Ruby CGI scripts to start a Linux command, parse its standard output and converting the bytes to the chunked transfer encoding ( https://en.wikipedia.org/wiki/...
2
votes
1answer
937 views

conditional pipe in bash

Is there any built-in way in bash to pipe output further if certain test condition is met? Essentially I want to know if I have to write following function myself or is there some good-practice-...
-1
votes
1answer
250 views

Create file - pipe to output

At first I must say that my English is not very well. I have to do my task from studies and I have a problem. I have to make file with version in the proper catalog. Information are in text file for ...
1
vote
1answer
1k views

Piping credentails to git push

Whenever I execute git push, I have to type my username and password at the prompt manually. However, I want to automate this process. So, I tried to pass the credentials to the command using ...
0
votes
1answer
337 views

Pipe in Environment variable in fish shell doesn't execute the first command?

I want to set fish_greeting to date --rfc-2822 | cowsay -f tux | lolcat (don't judge me). When I run date --rfc-2822 | cowsay -f tux | lolcat interactively, I get the proper output (the date in a ...
0
votes
2answers
441 views

How to pipe binary stdout to a compressed tls connection?

Not so long ago, I could use : cat somefile.txt | openssl s_client -connect server:port -quiet -comp However, this command doesn’t work, even with-ign_eof: $ cat somefile.bmp | openssl s_client -...