This is the table from man 5 terminfo
.
Do NOT hardcode terminal escape sequences. Use tput with the cap-names from the table below to get the right code for your terminal.
(P) | indicates that padding may be specified |
This is the table from man 5 terminfo
.
Do NOT hardcode terminal escape sequences. Use tput with the cap-names from the table below to get the right code for your terminal.
(P) | indicates that padding may be specified |
#!/bin/sed -f | |
# store rule in hold space | |
1 { h; d; } | |
# make borders wrap | |
s/\(.\)\(.*\)\(.\)/>\3\1\2\3\1|/ | |
# do some mucking around that can probably be done more elegantly by someone who is actually good at sed | |
x; G; h; s/\n.*//; x |
#!/bin/bash | |
owner=izabera nick=sedirc network=irc.freenode.net | |
echo " | |
# send bot data | |
1 { | |
s/.*/nick $nick/p | |
s/.*/user $nick $nick $nick :$nick/p | |
s/.*/cat factoids 2>\/dev\/null/e; H | |
b |
#!/bin/bash | |
exec {times}> times {typescript}> typescript < "${1-/dev/stdin}" | |
while read -r; do [[ $REPLY = ' "stdout": [' ]] && break; done # skip to this line | |
LANG=C | |
printf "Script started on %(%c)T\n" -1 >&"$typescript" # dummy | |
while read -r open; [[ $open = '[' ]]; do | |
read -r elapsed; read -r string; read -r close | |
eval printf %b%n "$string" characters >&"$typescript" # put count in $characters | |
printf "%s %s\n" "${elapsed%,}" "$characters" >&"$times" | |
done |
#!/bin/sh | |
LANG=C | |
compile() { | |
# some preprocessing and basic optimizations | |
code=$(printf %s "$1" | | |
(tr -dc '\133\135<>,.+-'; echo) | # ksh's builtin tr doesn't like []<>,.+- | |
sed -e :a -e 's/<>//g;s/><//g;s/+-//g;s/-+//g | |
s/\[-]/z/g;s/zzz*/z/g;s/[+-]z/z/g;ta') |
#!/bin/sh -e | |
target=${1?usage: $0 pid [fd]} | |
fd=${2-1} | |
fifo=fifo.$$ | |
log=log.$$ | |
mkfifo $fifo | |
echo writing to $log | |
tee $log <$fifo >/proc/$target/fd/$fd & |
#!/bin/bash | |
reverse () { | |
# $1 = name of a non sparse array | |
# $2 = index of first element | |
# $3 = index of last element | |
#(( $# != 3 )) && return 1 | |
# expand the values, save in a local array | |
#eval local array=("\"\${$1[@]}\"") |
#!/bin/bash | |
# source this to make your shell "case insensitive" | |
insensitive=( | |
# reserved words | |
case coproc do done elif else esac fi for function if in select then time until while | |
# builtin commands | |
alias bg bind break builtin caller cd command compgen complete compopt continue declare | |
dirs disown echo enable eval exec exit export false fc fg getopts hash help history jobs | |
kill let local logout mapfile popd printf pushd pwd read readarray readonly return set | |
shift shopt suspend test times trap true type typeset ulimit umask unalias unset wait |
#include <ctype.h> | |
#include <fcntl.h> | |
#include <linux/openat2.h> | |
#include <netinet/in.h> | |
#include <signal.h> | |
#include <stdlib.h> | |
#include <string.h> | |
#include <sys/socket.h> | |
#include <sys/syscall.h> | |
#include <unistd.h> |