I hereby claim:
- I am mhelsley on github.
- I am mhelsley (https://keybase.io/mhelsley) on keybase.
- I have a public key whose fingerprint is B31D 6147 08C6 3AD2 2848 F50D 102C 49AD 7831 F4C9
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
#!/bin/bash | |
# | |
# fdswap | |
# Based on https://www.redpill-linpro.com/sysadvent/2015/12/04/changing-a-process-file-descriptor-with-gdb.html | |
# Alternatives https://github.com/bewakes/fdswap | |
# Updated by | |
# anonymous friend of mhelsley | |
# mhelsley | |
# defanging, error handling, GDB verbosity/UI quirks, reduced appearance of magic numbers | |
# |
snap list --all | grep disabled | awk '{print $1 " " $3}' | while read SNAP REV ; do sudo snap remove $SNAP --revision $REV; done |
Many commands determine whether to color their output using escape sequences by checking if their output file descriptor is a terminal.
This doesn't work very well when piping that output into a pager like more or less.
(Ideally UNIX folks would have created a way to determine if executables in a pipeline preserve color escape sequences and if the output fd at the very end of a pipeline was a tty or not. But they didn't.)
So many commands have an explicit command line option that can be used to specify that the color output should turned on, off, or be switched based on the immedita-output-fd type.
This is a collection of the common ones on a typical Linux (especially the GNU-centric distros) system.