Skip to main content
4 votes

output of a command framed by a couple of '#' characters

If you want to make the lines the same length, the tricky part is printing a correct amount of # signs dynamically. You could do something like this (in Bash or zsh): #!/bin/bash fill() { local ...
ilkkachu's user avatar
  • 141k
3 votes
Accepted

How to modify this git alias so it can be run without the need to put multiword commands in quotation?

I think this will do what you want: git config --global alias.all \ '!'"f() { ls -R -d */.git | xargs -I{} bash -c 'echo {} && git -C {}/../ \"\$@\"' -- \"\$@\"; }; ...
larsks's user avatar
  • 36k
2 votes

output of a command framed by a couple of '#' characters

You could also use a tool for ASCII-art, e.g. install boxes. For details see also the long answer in related question. Adapted the example: psql -qAtc "SELECT version()" | awk {'print $1, $2'...
hc_dev's user avatar
  • 151
2 votes
Accepted

Why doesn't 'export' give the export attribute while 'set -a' does?

It's the one and same export attribute, just the help texts there aren't too consistent with each other. The export attribute is how the shell marks variables for (automatic) export. export gives the ...
ilkkachu's user avatar
  • 141k
1 vote

output of a command framed by a couple of '#' characters

Some things aren't actually worth writing code for, and this is one of those cases. I would expect the version of PostGreSQL to change infrequently, so it shouldn't need to be calculated every time ...
Martin Kealey's user avatar
1 vote
Accepted

output of a command framed by a couple of '#' characters

You should be able to output the result of that command using a combination of $() and quote marks like so- echo "### $(psql -qAtc "SELECT version()" | awk {'print $1, $2'}) ############...
kestrel's user avatar
  • 64
1 vote

Delete 2-line paragraphs, keep 3-line paragraphs, maintain newline between all

With GNU awk: awk 'BEGIN{FS=RS; RS=""} NF==3{print; print ""}' file Output: aaa aaaaaa bb bbb cc cccc ccccc cccc fff ff ggg gggg gggg hhh hhh hh hhhh Output contains one ...
Cyrus's user avatar
  • 12.4k

Only top scored, non community-wiki answers of a minimum length are eligible