Commit e70c26c5 authored by Glen Mével's avatar Glen Mével

remove trivial scripts

parent 5865620d
#!/bin/sh
# Colorize diff’s output (unified style).
#
# Note that ‘diff’ already supports colors but that, for some reason, it doesn’t
# colorize all lines (only the first line of each difference).
color="auto"
args=()
for arg in "$@" ; do
if [ "$arg" == "--color=never" ] ; then
color="never"
elif [ "$arg" == "--color=always" ] ; then
color="always"
elif [ "$arg" == "--color=auto" ] ; then
color="auto"
else
args+=( "$arg" )
fi
done
export LANG=C
if [ "$color" == "always" -o '(' "$color" == "auto" -a -t 1 ')' ] ; then
/usr/bin/diff -u --color=never "${args[@]}" \
|sed 's/^Only in/\x1B[43;1;30mOnly in/;
s/^File/\x1B[45;1mFile/;
s/^diff/\x1B[1;30mdiff/;
s/^--- /\x1B[1;31m--- /;
s/^+++ /\x1B[1;32m+++ /;
s/^@@/\x1b[34m@@/;
s/^-/-\x1b[41m/;
s/^+/+\x1b[42m/;
s/^ / \x1B[30m/;
s/$/\x1b[0m/'
else
/usr/bin/diff -u --color=never "${args[@]}"
fi
#!/bin/sh
# Launches a command out of the terminal.
# If coming from or going to a terminal, input and/or output are discarded.
#
# Usage:
# launch CMD …
# If the command is not available, exit with a detailed error message.
command -v "$1" >&- || "$1"
# Close file descriptors if needed.
if [ -t 0 ]; then
exec 0<&-
fi
if [ -t 1 ]; then
exec 1>&-
fi
# This one simply hides the messages from nohup (as nohup already
# redirects the stderr of the called program to its stdout):
exec 2>&-
# Launch the command.
nohup "$@" &
#!/bin/sh
# Print the current public IP adress to standard output
# with ‘wget’, from package wget:
#wget -qO- http://www.wgetip.com
# with ‘dig’, from package bind-utils:
dig +short myip.opendns.com @resolver1.opendns.com
......@@ -4,7 +4,7 @@
# less-like behaviour (that is, leave the normal console buffer unaltered).
# ArchLinux’s top does not use the alternate screen by itself, but it does
# clear the screen when it starts (which is annoying), and misses to do it
# again when it leaves (which is annoying to).
# again when it leaves (which is annoying too).
#
# See here for xterm control sequences:
# http://invisible-island.net/xterm/ctlseqs/ctlseqs.html
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment