LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 01-18-2016, 05:40 AM   #1
anindyameister
Member
 
Registered: Oct 2012
Posts: 47

Rep: Reputation: Disabled
Is there a way to print output data from within a pipeline ?


So I am running a command with fairly large output and piped it into various combination of grep and awks to extract specific data and assigning it to a variable by running the whole chain in substitution or backtick, all in one line. My question is, is there a way to view the full output of the first element of the pipeline without disturbing the downstream ? I've thought about teeing to a file but it seems a bit cumbersome. I just want to know if there's a lightweight and elegant solution to this. Thanks in advance.
 
Old 01-18-2016, 05:59 AM   #2
anindyameister
Member
 
Registered: Oct 2012
Posts: 47

Original Poster
Rep: Reputation: Disabled
ok, so i've found out a workaround that I should find the tty and tee into that so the pipeline can run as well as I can see the full output. Don't know if this is a acceptable fix. Please let me know.
 
Old 01-18-2016, 12:39 PM   #3
rknichols
Senior Member
 
Registered: Aug 2009
Distribution: CentOS
Posts: 3,440

Rep: Reputation: 1508Reputation: 1508Reputation: 1508Reputation: 1508Reputation: 1508Reputation: 1508Reputation: 1508Reputation: 1508Reputation: 1508Reputation: 1508Reputation: 1508
It's pretty straightforward as long as the volume of output isn't something ridiculous to be sending to the tty:
Code:
some_command | tee /dev/tty | rest_of_pipeline
 
  


Reply

Tags
bash, pipeline


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
how to pipeline to search tcpdump's data zerop Linux - Networking 1 08-01-2014 03:57 AM
Print only some strings from an output Hoxygen232 Programming 2 05-05-2013 10:27 AM
[SOLVED] Print proper output ankitpandey Programming 4 02-17-2013 02:53 PM
List all alternatives to encrypt data (for bash /pipeline)? frenchn00b Programming 0 01-06-2009 09:48 AM
LXer: pv (Pipe Viewer) - Shell pipeline element to meter data passing through LXer Syndicated Linux News 0 12-28-2008 09:20 PM


All times are GMT -5. The time now is 08:00 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration