Questions tagged [pipe]
A pipe connects the output of one program to the input of another program. This is especially used to implement the shell | operator.
197
questions
0
votes
1
answer
64
views
How do I enter the pipe symbol on my keyboard
On my keyboard there is a ¦ symbol: it's shown as the third character on a key with its position being on the bottom right of the key: I've been able to type it here by copying it to the clipboard ...
6
votes
1
answer
313
views
bash builtin "read" after a pipe "|" doesn't wait for user input
When I curl a script stored on my web server, it endlessly echos a prompt I coded in until I send ^c. All i do is a simple curl https://server/test.sh | bash. This is the code being ran through the ...
2
votes
1
answer
91
views
Pipe to compressed file but also print content to terminal
How do I maintain a readable output from my program while also putting that same output into a compressed file, gzip or otherwise, so I can parse it later?
I run a command that generates a lot of ...
1
vote
1
answer
140
views
Piping sudo <command> through another command adds excess whitespace
Background
I wanted to identify if <complex command pipeline> outputs any non-printable characters (it must be run with sudo), so I piped the output through od and was surprised to see each line ...
1
vote
2
answers
343
views
How to keep writing in a FIFO even if there's no readers
There's a service that pipes it's output to a named pipe, which I create with mkfifo name.
The service pauses if there's no reader in pipe. How to make it to keep piping the data even if there's no ...
0
votes
1
answer
30
views
Error when I specify multiple options in my PHP bash script
#!/usr/bin/php -d register_argc_argv=1
...
At the top of my PHP script, I have the above and it works well. However, I need to add another -q and changed it to #!/usr/bin/php -q -d register_argc_argv=...
1
vote
0
answers
391
views
Right After piping to "head"/"tail": "curl: (23) Failure writing output to destination"
When I curled a too long API call and wanted to show only the first 30 lines in the console with curl my_api_call|head -30, I ran into:
24 49931 24 12089 0 0 98k 0 --:--:-- --:--:-- -...
0
votes
2
answers
426
views
How to stop the bash script when a PIPED command meets an error?
I have some pipes in my bash script, notably mysqldump | mysql
How do I get the script to stop if any of the piped processes return non-zero exit code?
In my tests, if mysqldump fails, the script ...
0
votes
0
answers
18
views
Adding total session time
I'm trying to get the total session time a user has had in a month using the command last in a script.
last user | egrep -i month | tr -s ' ' '/' | cut -f11 -d/
when adding the results I'm using ...
0
votes
0
answers
76
views
grep and pipe combination to filter standat input
Why this is working
gdbus monitor -y -d org.freedesktop.login1 | grep org
Filtering output lines containing "org"
This is working
gdbus monitor -y -d org.freedesktop.login1 | (while read ...
2
votes
0
answers
157
views
How can I copy from a pipe file?
I have a program that creates a FIFO (named pipe) file in /path/to/directory, then deletes it. I have somehow managed to stop it being deleted, but still I can't read/write/copy anything on it.
For ...
0
votes
0
answers
35
views
Pipe raw .ts file to device block
Problem description
I have a set top box with satellite tuners and running minisatip. It sends satellite channels to a Pi 4 running TVHeadend which organises the channels. Both are on the same LAN.
I ...
0
votes
0
answers
22
views
Trying to figure out how to use < in a command [duplicate]
I've been learning docker which has led me to create a container with ubuntu. I am also kinda new to linux commands in general and was trying to get a better understanding of redirection.
I used > ...
0
votes
0
answers
91
views
"yes" command with finite number of "yes" answers
The yes command in linux is used to provide automatic "yes" answers to command prompts in linux:
yes | wget https://example.com
The issue is that, after execution of wget command the yes ...
0
votes
1
answer
56
views
Is pipe the same as expr pipe?
I search man expr and found expression 1 | expression 2 to reutnr expression 1 if it is neither an empty string nor zero; otherwise, returns evaluation of expression 2 if it is not an empty string.
...
0
votes
2
answers
78
views
Convert output file with the following columns to CSV removing the pipes
This is what I have in my output file:
v6_ntoa | v6_ntoa | id | client_syn_packets
---------------+--------------+-------------+--------------------
105.245.90.61 | 82.17.112.84 |...
0
votes
1
answer
394
views
Running multiple scripts with piped input/output
I wish to call multiple scripts from a single script file, with various inputs and outputs like this:
./file1.sh ip1 ip2 op1
./file2.sh op1 op2
and so on. What I mean is that the output given by ...
0
votes
1
answer
1k
views
bash pipe multiple outputs as input to other command
I am noob with shell script and I am trying to pass multiple arguments to an command.
I have a urls.txt file that looks as below
name1,http://url1
name2,http://url2
name3,http://url3
name4,http://url4
...
10
votes
2
answers
6k
views
How do I check if command failed... with a pipe?
So I have a script like this:
somecommad | grep --invert-match something
I'd like to be able to conditionally run a different command if somecommand fails. Here's what I tried:
somecommand | grep --...
1
vote
1
answer
551
views
How can I Pipe the output of FFMPEG 2 Levels of Piping in a bash script
I have been trying to pipe 2 levels deep.
I can pipe successfully:
ffmpeg | grep
ffmpeg | sed
I can not pipe
ffmpeg | grep | sed
ffmpeg | sed | grep
I don't understand, does ffmpeg limit to only ...
1
vote
1
answer
77
views
Any way to pause a task and then restart within a pipe
I use a command like
btrfs restore -iv /dev/sdc1 /RESTORED
estimated time of running it is few days
In every hour of running I see a lot of prompts like:
We seem to be looping a lot on /path/to/some/...
1
vote
1
answer
585
views
Can't escape a dot using backslash, Why? [duplicate]
So, following are the commands are I ran:
$ ~/Documents: touch ball.txt bool-txt bowl.txt bull.txt
$ ~/Documents: ls . | grep b..l\.txt
ball.txt
bool-txt
bowl.txt
bull.txt
I wasn't expecting bool-txt ...
0
votes
0
answers
100
views
Zero Traffic on while running pipeline application in dpdk
I have two Virtual Machines. Both of them have their port bridged. On one VM I run Pktgen DPDK to generate traffic. On the other VM my goal is to run DPDK's pipeline application. Now When I run ...
1
vote
2
answers
160
views
Hide stdout from a command
I'm running the following command as a non privilaged user: ethtool eth0 |tail -1 | awk '{print $3}', which results this output:
Cannot get wake-on-lan settings: Operation not permitted
yes
No ...
0
votes
0
answers
27
views
Can I directly split the project archive in kdenlive?
I created a huge project in Kdenlive. Now, I wanted to archive it and then move the archive onto a Samba share with almost 50 GB free space, because I'm running low on free disk space on my main PC (9....
0
votes
0
answers
76
views
Feeding output of nvidia-smi to tail command returns error
I have a custom nvidia-smi message where some additional information (e.g., username) is also output underneath the original output of the nvidia-smi message.
I want to feed that output to a tail ...
2
votes
1
answer
873
views
Sudo command is not asking password from stdin. And Failing
Whenever I am running any command with sudo, No password is asked from stdin.
Instead, it automatically takes a password from somewhere and fails.
Once All attempts are exhausted, my command is ...
0
votes
1
answer
75
views
does output from LHS of pipe become an arg for RHS of pipe
I'm having difficulty grasping how pipes work. Initially I thought of them as per the title but I couldn't get a simple example to work e.g.
mkdir temp
cd temp
echo "rubbish" > txtfile
...
2
votes
1
answer
2k
views
problem install pip ubuntu 16.04
I'm doing this to install pip:
apt-get install python3-pip
But when I try use the command I have this error:
# pip3 install --upgrade pip
Traceback (most recent call last):
File "/usr/bin/pip3&...
-1
votes
2
answers
78
views
Whats the difference between a pipeline operator and $()? [duplicate]
mint@mint-VirtualBox:/$ ls -l $(which cp)
-rwxr-xr-x 1 root root 153976 Sep 5 2019 /usr/bin/cp
mint@mint-VirtualBox:/$ which cp | ls -l
total 1043228
lrwxrwxrwx 1 root root 7 Jan 21 15:09 ...
1
vote
1
answer
89
views
find command is not able to find piped file
I have a file named .sock in /var/spool/ dir.
Here is the result of ls -al /var/spool/
drwxr-xr-x. 9 root root 121 Dec 16 09:55 .
drwxr-xr-x. 19 root root 267 Dec 14 10:47 ..
drwxr-xr-x. 2 ...
0
votes
1
answer
405
views
Why is piping operator used here?
Here are two commands I'm trying to understand. The first command downloads an installation script for NVM (nodejs version manager) and executes it. The second command installs nodejs using newly ...
1
vote
1
answer
159
views
Piped commands run with sudo prefix result in indented output
I have an interesting issue on most of my servers, where commands prefixed with sudo and piped | to another program end up with indented output.
Note that I'm going to use lsb_release command for the ...
1
vote
2
answers
612
views
Shellcheck recommendation to double-quote variable does not work when piping to cut
I'm making a script to print ZFS filesystem info - currently in the testing phase, and I'm getting a strange error.
The relevant bit of my initial script is this:
zfs_human="$(zfs list | head -n ...
2
votes
2
answers
1k
views
Why Command Substitiution Works And Pipeline Not [duplicate]
I am practing | pipeline to pass output.
Firstly, I tried basename as
$ basename -a $(ls test_directory/*)
This line works as expected and showed only file's name without directory's.
But when I try ...
7
votes
2
answers
2k
views
Bash function to robustly pipe terminal output to vim
I often re-direct my terminal output to vim, in this fashion, which I get tired of typing all the time:
ls | vim -
I would like to define a function v to do this for me, i.e I want to be able to type:...
1
vote
1
answer
1k
views
Pipe password argument to mount shell command
Status quo
Given are following /etc/fstab mount points:
//server/app /home/user/server/app cifs noauto,user,vers=3.11 0 0
//server/code /home/user/server/code cifs noauto,user,vers=3.11 0 0
These ...
1
vote
1
answer
2k
views
How to get video audio stream using ffmpeg pipe fdkaac m4a?
I want final file as .mkv containing video stream copy and audio stream encoded by fdkaac bt unfortunately i only get audio file pls help me how to pipe video stream also here???
I tried this:
...
2
votes
0
answers
108
views
Help getting SSH server working again?
I have a ubuntu desktop on my home network that I used to be able to ssh into from several different machines, but about a week ago it stopped working. The only thing that I can think of that I ...
0
votes
1
answer
205
views
use systemd-escape in an interavtive way
If we use systemd-escape SomePassword, the password will be stored in bash_history file. Is it possible to use it in an interactive way?
cat | systemd-escape fails as systemd-escape expects the ...
0
votes
1
answer
240
views
Pipe script output in terminal to filter lines
#!/bin/bash
for f in *.{jpg,png,webm,mp4}; do mv "$f" "$(sed 's/[^0-9A-Za-z_.]/_/g' <<< "$f>; done
Currently using this script to turn all of the specified files of that extension and ...
0
votes
0
answers
122
views
Xorg input device from a named pipe
I am trying to create a virtual input device that does a complex remapping of key presses of an existing keyboard. The remapped output stream is written to a named pipe which is supposed to serve as ...
0
votes
1
answer
345
views
Custom Commands on Terminal with pipe character
I need to make some custom commands on Ubuntu, everything is working fine until I found that my new custom command requires to have | as a input parameter.
So, when I created my function it is not ...
1
vote
1
answer
864
views
Terminal window doesn't show my input after using popen() in my program
In my C++ program I use popen() to read video frames with ffmpeg. When program stops on it's own or I close it with Ctrl+C everything I type into terminal just never appears (but it's there). I do ...
2
votes
1
answer
2k
views
Communicating via a local socket or named pipe
I'm reading a book that is related SSH. I can't figure out what this sentence means.
SSH clients communicate with the agent via a local socket or named
pipe whose filename is stored in an ...
1
vote
1
answer
238
views
SIGQUIT breaks the pipe
Linux ping utility can produce some statistics on receiving SIGQUIT without terminating. It looks like this:
PING 8.8.8.8 (8.8.8.8) 56(84) bytes of data.
64 bytes from 8.8.8.8: icmp_seq=1 ttl=45 time=...
0
votes
3
answers
393
views
How to treat an output of find as a string not a refrence to a file or directory
when I run
find ~/foo/bar/. -mindepth 1 -maxdepth 1 -type d
I get an output of all subdirectories of the given path. e.g.
/home/user/foo/bar/a
/home/user/foo/bar/b
...
/home/user/foo/bar/abcd
...
4
votes
2
answers
364
views
cat | dd inconsistent behavior
From a given a file, I have a requirement to create a copy that is padded with zeros to a specific size.
If you create a file with the following.
echo test >testfile
The output of the following ...
5
votes
2
answers
2k
views
Piping the output of comand columns
I am using lolcat to get the output of ls in color. To do this i have copied /usr/bin/ls to /usr/bin/lsslss (to avoid an endless loop since alias cannot acccept $* or $@) and I have added the function:...
1
vote
1
answer
2k
views
What does `cat file | ssh host 'cat - >file'` do?
this is the script:
#!/bin/bash
usage() {
echo "deploy-nginx.sh --production|--staging"
}
case "$1" in
--staging) NGINX_CONF="conf/nginx-staging"; HOST="staging" ;;
--production) ...