Wednesday, May 1, 2024
13
rated 0 times [  13] [ 0]  / answers: 1 / hits: 8848  / 1 Year ago, sat, december 24, 2022, 9:18:10

It is possible to print the result of 2 commands side by side...



Something like this



something `ls -l /a` `cat bla.txt`


result:



total 24                                                #while [ 1 = 1 ]; do
-rw-r--r-- 1 wolfy wolfy 194 Aug 13 08:50 c.in # echo "bla"
-rwxr-xr-x 1 wolfy wolfy 52 Sep 24 11:48 bla.sh #done
-rwxr-xr-x 1 wolfy wolfy 38 Sep 24 11:48 bla1.sh echo "bla"
-rwxr-xr-x 1 wolfy wolfy 147 Sep 24 11:54 ble.sh


I know that pr can do something like this with files, but I didn't find a way to do this for commands...


More From » command-line

 Answers
2

You can use process substitution



pr -m <(cmd1) <(cmd2)


though in your case, since you have one command and one file:



ls -l | pr -m - bla.txt

[#29007] Saturday, December 24, 2022, 1 Year  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
tionavocad

Total Points: 189
Total Questions: 101
Total Answers: 118

Location: Liechtenstein
Member since Wed, Dec 8, 2021
2 Years ago
tionavocad questions
Tue, May 23, 23, 00:07, 1 Year ago
Tue, Jan 17, 23, 20:38, 1 Year ago
Sun, Oct 10, 21, 04:50, 3 Years ago
Tue, Jun 7, 22, 08:50, 2 Years ago
;