0
votes
2answers
19 views

CLI tool to graphically select lines during piped commands

Is there a tool similar to choose that I can plug into chain of commands that will let me select (multiple) lines for the next step? choose unfortunately doesn't "pass on" the line you select, ...
2
votes
1answer
43 views

Is there a way around broken pipe?

I have a directory with a large number of files. ./I_am_a_dir_with_many_subdirs/ Within a script I'd like to find all subdirs in it, to sort them and to output to a bash array. So, I do: ...
0
votes
1answer
130 views

How can I pipe the output of *all* entered shell commands into another? (e.g. pipe everything into 'lolcat')

Good Afternoon, (OS X user) I am specifically trying to pipe the output of every shell command I type into the ruby gem 'lolcat' (which makes the output to the terminal rainbow colored). Is there a ...
1
vote
1answer
359 views

Flushing a named pipe

I am using the following to redirect output from my script to both terminal and log file while appending date to every line that goes to the log file: NPIPE=/tmp/$$_$RANDOM.tmp mknod $NPIPE p tee ...
2
votes
1answer
801 views

How to redirect multiple bash commands to a variable AND screen?

I would like to capture a subshell's output in a variable and print it in the terminal screen simultaneously. Is it possible to do this by assigning the subshell to a variable and piping stdout and ...
4
votes
3answers
108 views

Transparent usage of temporary files as means of piping

As many of us are surely aware, it's always a good idea to make your program accept stdin input. Very many programs do allow that *nix environments. This lets us do cool things like piping echo "foo" ...
3
votes
1answer
199 views

Redirect stdout to multiple programs

I'm doing some stream processing of some quite substantial files-- I was wondering if there was a way to split stdout in order to pipe to multiple programs. What I'd like to do is something like this: ...
2
votes
2answers
587 views

Setting pipefail for a single piped command

I need to execute a number of piped shell commands from a non-BASH script (namely PHP script) like these: command1 | command2 | command3 so that, if command1 fails with a non-zero exit code, each ...
4
votes
5answers
279 views

How do I pipe a list of numbers straight from the shell into a command?

How do I pipe a list of numbers straight from the shell into a command? For exampe something like this [1,2,3,4] | sort would give 1 2 3 4 EDIT: In response to the answers kindly posted so ...
0
votes
2answers
294 views

Linux output redirection not working with awk

I'm trying to write a nice csv-file based on some output from top. I reformat the output with awk like this: top -b | nawk '/Cpu/ || /Tasks/ { if($1 ~ /Cpu/) { printf "%s,",$3 } else { printf "\n" } ...
4
votes
1answer
83 views

Launch only the command if the previous one worked inside SSH, shell

I've got a SHELL script which is using a pipe to separate my two commands: ssh -oBatchMode=yes user@hostname "mysql -u yop -pyop -c yop | echo test" The problem is even if my connection to MySQL ...
3
votes
2answers
292 views

How can I run several parallel shell jobs and monitor all of them at once?

I have a large number of large files (hundreds of files, hundreds of MB each) which I need to pipe through a number of programs to filter and convert them. I'm taking advantage of multiple CPU cores ...
2
votes
3answers
1k views

Can I use pipe output as a shell script argument?

Suppose I have a bash shell script called Myscript.sh that need on argument as input. But I want the content of the text file called text.txt to be that argument. I have tried this but it does not ...
2
votes
2answers
318 views

What's the best command to use to change a timestamp to readable date when 'tail -f'-ing a log file?

I have a program which logs like this: 1324218770.7644 INFO etc What's the best Linux shell program to pipe that through to change the timestamps to a human readable format like Sun 18 Dec 2011 ...
1
vote
1answer
162 views

How can I view the full exception thrown by a script in the shell?

When I'm running my ruby script, I'm getting an exception. However, since I'm running Ubuntu in VMware Fusion, I can't resize my terminal window so I can't see the whole excecption. How can I view ...
5
votes
3answers
2k views

How can I specify command line arguments using pipes in Linux?

I'm a newbie to shell programming and have no idea how to solve this problem. I just downloaded a file from the Internet to the default directory ~/Downloads. I want to move that file to another ...
1
vote
4answers
3k views

Rsync to stdout?

I have access to backup server via rsync protocol (only rsync, nothing else). Now, I want to fetch file from there (which is .tar.gz) and pass it directly to tar command, without saving the archive in ...
1
vote
3answers
652 views

Double pipes in Linux

Is it possible to do a command in Linux with "double pipes", like this? blah | blah | blah
2
votes
1answer
98 views

How to construct shell redirection on command line

Consider the following command in Unix: echo 0123456789 | cat >/tmp/foo &> /tmp/bar The echo is sent to /tmp/bar. However, what I really want is to redirect the stdout and stderr output ...
4
votes
1answer
899 views

emacs as a pager?

I am looking for a way to use emacs as my pager command in the shell (for example with man or to scroll the output of an asynchronous command with a large amount of output). I use emacsclient as my ...