Sponsored Content
Top Forums Shell Programming and Scripting Merging output of two commands for a third command Post 302359921 by Corona688 on Wednesday 7th of October 2009 05:32:01 PM
Old 10-07-2009
You can use this sort of structure:

Code:
( foo; bar; cat mumble; baz ) | whatever

 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Command display output on console and simultaneously save the command and its output

Hi folks, Please advise which command/command line shall I run; 1) to display the command and its output on console 2) simultaneous to save the command and its output on a file I tried tee command as follows; $ ps aux | grep mysql | tee /path/to/output.txt It displayed the... (7 Replies)
Discussion started by: satimis
7 Replies

2. UNIX for Advanced & Expert Users

Merging two command into single line

1. du -sch int* | grep "total" | awk '{print $1}' first command result is 17K 2. echo "B" Result B i want the output is 17KB (2 Replies)
Discussion started by: kingganesh04
2 Replies

3. UNIX for Dummies Questions & Answers

Merging the PS and TOP output

Hey guys, I'm trying to merge the output from the ps and top commands; since I need the full command used (only showed in the ps), and the cpu usage with some decimal numbers (i.e.: 0.05%, only showed in top). After exporting to different files, I was thinking of doing an egrep with the... (0 Replies)
Discussion started by: EnioMarques
0 Replies

4. Shell Programming and Scripting

Redirecting command output as well as commands

I have a Bourne Shell script that is normally run as a background job and redirects it's output to a file internally (using exec >>); I use "set -x" to capture each command which provides me with a nice shell execution log if it all goes to pieces. I now also need to be able to also run this as... (4 Replies)
Discussion started by: AncientCoder
4 Replies

5. Shell Programming and Scripting

awk command - column merging

I have two files having 3 coulms and 1 column respectively file1.txt 0 22.89 35.60 10 22.80 35.61 20 22.70 35.63 30 22.32 35.68 50 19.23 35.79 75 16.10 35.59 100 15.00 35.52 125 14.45 35.46 150 13.91 35.41 200 12.94 35.28 ... (7 Replies)
Discussion started by: shashi792
7 Replies

6. Shell Programming and Scripting

merging sed commands

Hi, I've a shell that uses two sed commands to tailor a file. sed 's/ */ /g' | sed 's/%/%%/g' Is it possible to merge this in to a single sed? Thanks! (2 Replies)
Discussion started by: dvah
2 Replies

7. Shell Programming and Scripting

Compare output from two commands

Hello folks, I would like ask for a help in one script I'm currently working on. Main goal is to compare size of file available on remote site and file already downloaded (check if downloaded file is complete and non corrupted). # Check if files were downloaded correctly for FILES in... (6 Replies)
Discussion started by: brusell
6 Replies

8. UNIX for Dummies Questions & Answers

Merging the content of 2 cells in XLS using UNIX command

Hi All, I am creating an XLS using unix which fetches the data from database. In the first row i have 2 columns which i want to merge. Is it possible to merge the columns using unix command? Thanks, Sashanka (1 Reply)
Discussion started by: Sashanka_545
1 Replies

9. Shell Programming and Scripting

Insert title as output of command to appended file if no output from command

I am using UNIX to create a script on our system. I have setup my commands to append their output to an outage file. However, some of the commands return no output and so I would like something to take their place. What I need The following command is placed at the prompt: TICLI... (4 Replies)
Discussion started by: jbrass
4 Replies

10. Shell Programming and Scripting

Arranging output for 2 commands

I am trying to run 2 sets of commands but want their output in a particular format. The 2 commands are : md5sum $WAR_DIR/$war and java -jar $WAR_DIR/$war | grep build.release.version | awk '{print $3}' The first command gives an output of 5f5261a33b92a36f80218cf14e8271ad ... (4 Replies)
Discussion started by: Junaid Subhani
4 Replies
Devel::Dwarn(3pm)					User Contributed Perl Documentation					 Devel::Dwarn(3pm)

NAME
Devel::Dwarn - return Dwarn @return_value SYNOPSIS
use Devel::Dwarn; return Dwarn some_call(...) is equivalent to: use Data::Dumper::Concise; if (wantarray) { my @return = some_call(...); warn Dumper(@return); return @return; } else { my $return = some_call(...); warn Dumper($return); return $return; } but shorter. If you need to force scalar context on the value, use Devel::Dwarn; return DwarnS some_call(...) is equivalent to: use Data::Dumper::Concise; my $return = some_call(...); warn Dumper($return); return $return; If you need to force list context on the value, use Devel::Dwarn; return DwarnL some_call(...) is equivalent to: use Data::Dumper::Concise; my @return = some_call(...); warn Dumper(@return); return @return; If you want to label your output, try DwarnN use Devel::Dwarn; return DwarnN $foo is equivalent to: use Data::Dumper::Concise; my @return = some_call(...); warn '$foo => ' . Dumper(@return); return @return; If you want to output a reference returned by a method easily, try $Dwarn $foo->bar->{baz}->$Dwarn is equivalent to: my $return = $foo->bar->{baz}; warn Dumper($return); return $return; If you want to immediately die after outputting the data structure, every Dwarn subroutine has a paired Ddie version, so just replace the warn with die. For example: DdieL 'foo', { bar => 'baz' }; TIPS AND TRICKS
global usage Instead of always just doing: use Devel::Dwarn; Dwarn ... We tend to do: perl -MDevel::Dwarn foo.pl (and then in the perl code:) ::Dwarn ... That way, if you leave them in and run without the "use Devel::Dwarn" the program will fail to compile and you are less likely to check it in by accident. Furthmore it allows that much less friction to add debug messages. method chaining One trick which is useful when doing method chaining is the following: my $foo = Bar->new; $foo->bar->baz->Devel::Dwarn::DwarnS->biff; which is the same as: my $foo = Bar->new; (DwarnS $foo->bar->baz)->biff; SEE ALSO
This module is really just a shortcut for Data::Dumper::Concise::Sugar, check it out for more complete documentation. perl v5.10.1 2011-01-20 Devel::Dwarn(3pm)
All times are GMT -4. The time now is 07:58 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy