Last call to make your voice heard! Our 2022 Developer Survey closes in less than a week. Take survey.

Questions tagged [pipe]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0 votes
1 answer
16 views

Pipe into command stored in bash variable

I enter two command in bash: $export g='grep "something"' $echo "something and another thing" | $g But it doesn't work. I want the second command to be evaluated by bash as : ...
user avatar
0 votes
1 answer
20 views

Why tail to same file create a empty file, or empty the file?

I try to maintain the last lines of a file, but when tail -n 10 test.txt > test.txt create or empty the file... SO: Ubuntu server Example: #test.txt file 20 May 23 12:24 test.txt a a a a a a ...
user avatar
0 votes
2 answers
37 views

how to extract a certain field from standard output with cut?

I have this output and want to extract the IMAGE ID from it $ podman image ls | grep youtube-dl localhost/youtube-dl latest 2d4e37c4d609 3 hours ago 205 MB All I know piping ...
user avatar
  • 217
1 vote
2 answers
88 views

cmd pipe -> System cannot find specified path

Using cmd on Windows 10 Pro 21H2, when I try echo Hello | find "Bye" I get The system cannot find the specified path. Same thing if trying echo Hello | C:\Windows\System32\find.exe "...
user avatar
0 votes
0 answers
10 views

Is it possible to trigger a 550 SMTP answer from a script Postfix piped a mail to?

I want to prevent backscatter from within a mailing list script that I use on my Postfix mail server. Mail for a mailing list hosted there is piped to my script. At this point, Postfix can't know if ...
user avatar
1 vote
1 answer
484 views

Is it possible to pipe qemu-img into SSH target?

I tried the following command, but only an empty file is created on the target and the command stays open qemu-img convert -f raw -O vmdk /dev/sda1 - | ssh foo@bar "cat > /home/foo/foobar.vmdk&...
user avatar
  • 451
0 votes
2 answers
182 views

Piping nc to sed and evaluate datetime for each row

Could someone provide any idea, how could i pipe data from nc to sed (or awk, or anything) and evaluate and write to file a timestamp after each row? What i have: # cat /etc/systemd/system/ncserver....
user avatar
  • 3
0 votes
1 answer
251 views

How can wireshark.exe on windows read from a pcap file stream?

This is probably less a wireshark question and more a "how do I pipe a file into an application" on windows. On linux, I can capture a pcap file on another host with tcpdump and pipe it back ...
user avatar
0 votes
1 answer
115 views

Linux shell: Pipe stderr and stdout to one file AND to individual files at the same time (using tee?)

I would like to form a pipe-stream that captures stdout to one file and stderr to another file AND both in a third file (so also the complete terminal output is in one file) somehow like this: process ...
user avatar
0 votes
1 answer
217 views

Linux does STDOUT | STDIN piping write data to disk?

I was planning on passing encryption keys to zfs load-key pool/set through stdin. The keys passed are generated by another program in HEX format and dataset is configured to have keylocation=prompt, ...
user avatar
0 votes
2 answers
144 views

nethogs -t | awk '{print $0}' return no output

nethogs is a linux process bandwidth monitoring tool. https://github.com/raboof/nethogs nethogs -t it's output looks like this. Refreshing: sshd: root@pts/0/4002/0 0.185156 0.0773437 unknown ...
user avatar
0 votes
2 answers
2k views

Run a multiline bash script piped from stdin

I'm looking for a simple way to include multi-line scripts inline in documentation to make it transparent what each step does. This works echo "echo 1234" | bash So does this echo 'for N in 1 2 3; ...
user avatar
0 votes
0 answers
21 views

Is there any way to "stop following" in less without pressing Ctrl+C?

If I pipe the output of a long-running command to less, for example: foreman start | less -SR And I now press F to follow the output of foreman, is there any way to tell less to stop following, ...
user avatar
  • 1,078
7 votes
3 answers
7k views

tee and assigning to variable?

I need to see output on the screen and at the same time grep the output and send grep result to variable. I think it can be done with tee but I can't figure out how exactly. I tried mycommand | tee ...
user avatar
  • 2,045
0 votes
2 answers
158 views

re-parenting to screen two processes joined by pipe [duplicate]

Let's say in a PuTTY connection I start mysqldump --host host1 --databases db1 db2 db3 | mysql which creates two processes: mysqldump with PID 5800 and mysql with PID 5801. Is it possible to let the ...
user avatar
1 vote
1 answer
882 views

Mysqldump to compressed file

Situation: 1. mysql is backuped to disk with mysqldump (~250 GB) 2. dump is compressed with bpzip2 3. dump is moved to another DC 4. disk usage again in good state Problem: Filesystem usage peaks, ...
user avatar
  • 21
1 vote
2 answers
956 views

Send email if script outputs string

I found this line: sh script.sh | grep 'NO' 2>&1 > grep.log && /usr/bin/mail -s "grep found something" m@mail.com < grep.log which will write the output of script.sh to grep.log ...
user avatar
0 votes
1 answer
1k views

Command that returns exit code still returning 0 when using "command 2>&1 | tee -a /var/log/file.log"

I'm running a script that executes a command and save the output to a file in /var/log. After that, it gets the exit code and execute another command based on an if/else condition. The problem is: 2>&...
user avatar
  • 95
1 vote
3 answers
119 views

How to compress spaces in bash command output?

I work on a small screen and I'm trying to make the output of this command shorter, but I cannot get it to work. Command: docker container ls --all Output (too wide!): CONTAINER ID IMAGE ...
user avatar
  • 433
0 votes
1 answer
1k views

Backuppc | Got fatal error during xfer (aborted by signal=PIPE)

I am running backuppc version 3.3.1 on an Ubuntu 16.04.5 LTS, I try to backup several Linux servers, almost Debian, ubuntu or proxmox hosts. My issue is that when I run the Full/Incermental backup ...
user avatar
0 votes
1 answer
263 views

Are bash pipes lazy or eager?

I was watching this command run tar cf - 20180412 -P | pv -s $(du -sb 20180412 | awk '{print $1}') | gzip > 20180412.tar.gz 9.02GiB 0:01:20 [ 114MiB/s] [============================================...
user avatar
  • 213
0 votes
1 answer
538 views

set up master slave over ssh and port pipe for a Mysql replication

Everything started when I was asked to set up a syncing method for our Mysql server. Considering that I am a developer I got into deep waters first with DBA and now I found myself into SysAdmin. So I ...
user avatar
1 vote
0 answers
155 views

dovecot/postfix/postgres and piping mail to script

I'm trying to pipe mail to script I added lines like these to /etc/postfix/master.cf: myscript unix - n n - - pipe flags=F user=root argv=/var/myscript/igotmail.sh ${sender} ${size} ${recipient} ...
user avatar
2 votes
0 answers
329 views

stream a command's stdout, and merge with terminal's stdin to a single stdout

This answer shows numerous ways to stream multiple commands into another command, but since they use subshells you can't do stdin. While you can achieve this with named pipes, it's somewhat ugly and ...
user avatar
  • 173
7 votes
2 answers
7k views

How to send text to stdin of docker container?

I have a docker container which runs a java program in foreground on startup. The java program listens to input on stdin. How can I programmatically send text to the java program? The container is ...
user avatar
  • 387
-1 votes
1 answer
342 views

dovecot thinks alias to pipe is a user, rejects email

I have an AWS EC2 instance running Amazon Linux with Postfix for serving mail. I have only local users -- no virtual users -- and my users and aliases are served via PostgreSQL. My aliases table in ...
user avatar
0 votes
2 answers
893 views

Large mysql dump pipe to s3

Is there any problem in doing this with lots of data? mysqldump ... | gzip | s3cmd put - s3://bucket/file.sql.gz The MySQL dump is about 100GB in size. What happens if gzip or s3cmd can't process ...
user avatar
1 vote
0 answers
247 views

Read named pipe as output to echoing to a pipe

I've created a few named pipes for a few client programs such as cec so I only need to make the connection once in the background and just pipe in commands. Most of the time I don't need to read the ...
user avatar
  • 11
3 votes
3 answers
942 views

Grep regex Stdout to telnet

I'm trying to use grep to get a regex result and pipe the results on-the-fly to telnet running an open port to a node server. The grep received continuous, but varied in interval, commands from a ...
user avatar
  • 179
1 vote
1 answer
209 views

Can I filter output from `tail` with the `-f` flag?

I'd like to tail -f the output of access_log on RHEL 6.8 but pipe and grep that output to act as a filter. Is there such an option? That is I'd like live output from: # tail -f error_log | grep <...
user avatar
  • 289
1 vote
1 answer
1k views

gzip piped output into ssh command

I make backup over ssh like this: mysqldump -u dbuser -pXXXXXXXX dbname | ssh -i ~/.ssh/id_rsa_backup backup@my.server.com 'cat > /var/backups/services/my_service/db/$(date +"%Y-%m-%d").sql' How ...
user avatar
  • 586
2 votes
1 answer
1k views

Starting and stopping piped processes with Supervisor

I have a situation where I pipe the output of ffmpeg into a PHP script for some processing. I might have a few of these processes running at any given time and I figured to start and stop them I might ...
user avatar
  • 3,706
8 votes
2 answers
3k views

Cat, Grep, Redirect Output.... Blank File?

I just ran cat /opt/webapplications/Word/readme.log | grep -v 'Apple' and I got the output on the cli that I was expecting, which was all the lines in readme.log that did not contain 'Apple'... ...
user avatar
1 vote
1 answer
114 views

How do I pipe stdout and std error to a file and back to stdout on Windows?

On Windows when running a batch script I want to record the output of I run: myprogram.bat 1> mylog.log 2>&1 Which is great - but I have to run a separate tail process to read the output ...
user avatar
  • 2,659
0 votes
2 answers
484 views

Streaming stdout

I have a script that outputs a lot of debug data that I would like to avoid to save on disk (specially since the file system is on a flash memory card). So I run it on the background with nohup + &...
user avatar
  • 101
3 votes
1 answer
11k views

How to avoid "in use by another process" errors when piping output through a program?

In a Windows environment, are executable programs that are used to process piped output guaranteed to be unique tasks if called from different CMD environments? For example, suppose script1.cmd ...
user avatar
  • 425
1 vote
1 answer
582 views

How to pipe a file being written to?

I have a binary file that is being written to continuously. I need to read the full content of that file to a pipe (either to nc or to a FIFO) and keep reading it while its is written (i.e. the ...
user avatar
  • 284
12 votes
5 answers
25k views

Unzip from stdin to stdout - funzip, python

The goal is to read a zip file from stdin and uncompress to stdout. Funzip works and is the solution I am looking for, the zip contains a single file, unfortunately funzip fails when the compressed ...
user avatar
-1 votes
1 answer
690 views

Cron: Execute python script, capture stdout & stderr and send via msmtp [duplicate]

I try this for almost 4 hours now, in different ways. I googled a lot, but nothing I try work as expected. I have a simple .msmtprpc file, that allows me to send mails like this: echo -e "Subject: ...
user avatar
  • 55
1 vote
1 answer
5k views

wget and pipe to tar in the background

I am trying to download a large file which is .tar.gz and (> 2GB) in size. The bash script also does lots of other things, so I want to kick off the download and then continue processing other ...
user avatar
  • 4,886
6 votes
2 answers
7k views

Apache errorlog piping fail

Trying to log to a central syslog server, either direct using Apache's ErrorLog to pipe to logger, or getting syslog to forward, but nothing is working and the errors are not making sense to me. I can ...
user avatar
1 vote
2 answers
1k views

How to pipe postfix into Codeigniter controller

I currently have postfix piping into a PHP script to process the email via an alias. catchall: |/var/www/vhosts/website/httpdocs/scripts/incoming_mail.php However, I wish to use the DB config etc ...
user avatar
0 votes
0 answers
344 views

Remote packet capturing using fifo and dumpcap

I'm currently working on two linux servers where one server is running in 2.6.18-274.el5(Server A) and the second one in CentOS 7 (Server B). My requirement is to capture the packets of the network ...
user avatar
  • 111
6 votes
3 answers
2k views

Postfix - Pipe multiple recipient message as a single message

I am trying to pipe emails through Postfix to a Python script I have. Currently, messages with multiple recipients are piped to the script once for each recipient. I would like these messages to be ...
user avatar
  • 161
1 vote
1 answer
468 views

Postfix pipe mail at user level

I am trying to filter mail at the user level. I have CentOS and Postfix installed. I managed to install a filter on the server and its working great, except, instead of filtering by user, all emails (...
user avatar
  • 11
1 vote
1 answer
1k views

Pipe multiple files into one tar gz

I'd like to call mysqldump to create multiple backup files and then archive them in one tar.gz. I am following this tutorial on mysqldump part: http://dev.mensfeld.pl/2013/04/backup-mysql-dump-all-...
user avatar
0 votes
2 answers
216 views

Unzip piping order

I have a file, foo.zip which looks something like this: foo.zip -- fileA.txt -- fileB.txt I can pipe the output of the extracted files like this: unzip -p foo.zip *.txt | something My problem is ...
user avatar
  • 115
3 votes
1 answer
519 views

does email pipe to program cause problems with unicode characters?

I'm piping incoming mail into a PHP script, immediately storing the RAW email in a MySQL db. It works very well, except ~0.7% of emails arrive with a truncated message body. I found someone whose ...
user avatar
  • 145
1 vote
1 answer
111 views

pipe rrd to a new directory

I am chrooted and running out of drive space, so I mounted back to the host drive which has plenty of space but cannot seem to redirect the outputted data to my empty drive [root@localhost rra]# ls /...
user avatar
  • 181
2 votes
3 answers
21k views

Can't pipe echo to netcat?

I have the following command: echo 'HTTP/1.1 200 OK\r\n' | nc -l -p 8000 -c and when I curl localhost:8000 I am not seeing HTTP/1.1 200 .. being printed. I am on mac os x with netcat 0.7.1 Any ...
user avatar
  • 161