View init.bash
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
if [[ ${KSH_VERSION+${!KSH_VERSION}} == .sh.version ]]; then | |
typeset -n FUNCNAME=.sh.fun | |
if builtin pids 2>/dev/null; then | |
function BASHPID.get { .sh.value=$(pids -f '%(pid)d'); } | |
elif [[ -r /proc/self/stat ]]; then | |
function BASHPID.get { read -r .sh.value _ </proc/self/stat; } | |
else |
View .xinitrc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
shopt -s extglob lastpipe | |
shopt -u assoc_expand_once | |
function xinitrc_main { | |
typeset myRootPath | |
if myRootPath=$(dirname "$(readlink -sne -- "${BASH_SOURCE[0]}")") && [[ -d $myRootPath ]]; then | |
source "${myRootPath}/shell/functions" |
View .bash
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function initializeBuiltins { | |
typeset libdir=${fsRoot%%+(/)}/usr/lib64 | |
if [[ $(file -b --mime-type -- "${libdir}/ctypes.so") == 'application/x-sharedlib' ]]; then | |
typeset -a ctypes=( | |
callback | |
dlcall | |
dlclose | |
dlopen | |
dlsym | |
pack |
View filemerge.ksh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/ksh | |
typeset -T FileComparer=( | |
typeset src dst | |
typeset -a mv diff rm | |
compound _=( | |
_Bool unpackComplete=false | |
_Bool scanComplete=false | |
) |
View minecraft.bash
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Stupid game. | |
# minecraft -c | -s [ -p ] | |
function minecraft { | |
typeset \ | |
jvm=${JAVA_HOME}/bin/java \ | |
worldPath=~/doc/mcdata2 \ | |
serverPath=~/doc/programs/ServerJarStorage/Release\ 1.8/minecraft_server.jar \ | |
clientPath=~/doc/programs/Minecraft.jar | |
typeset opt OPTARG OPTIND OPTERR=0 |
View fixperms.bash
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Quickly adds world read permissions to files and world read/write permissions | |
# to directories recursively. «-u user[:group]» will additionally chmod files | |
# and directories recursively. | |
function fixperms { | |
typeset -a paths | |
typeset chownUserGroup | |
until ${1+'false'}; do | |
case $1 in | |
-u) |
View logproc.ksh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ksh | |
typeset -T Record=( | |
integer uid | |
integer date=0 | |
typeset description | |
) | |
typeset -T Log=( | |
Record -h '(internal) Array of log records.' -a records |
View gist:3b2c7e9f9980cb2d0f1f30b719df010f
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
NAME | |
cksum,md5sum,sum - print file checksum and block count | |
SYNOPSIS | |
cksum,md5sum,sum [ options ] [ file ... ] | |
DESCRIPTION | |
sum lists the checksum, and for most methods the block count, for each file | |
argument. The standard input is read if there are no file arguments. getconf | |
UNIVERSE determines the default sum method: att for the att universe, bsd |
View Version ABIJM 93v- 2014-12-24
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(ins)root@ormaaj-laptop (162321) ~ # /mnt/ormaaj-laptop/ksh93 -c 'typeset -p .sh; print -v .sh; builtin -l' | |
namespace sh | |
{ | |
typeset -l -i lineno=0 | |
math='' | |
op_astbin=/opt/ast/bin | |
typeset -i pwdfd=10 | |
typeset -C sig=() | |
typeset -C stats=() | |
typeset -s -i subshell=0 |
View multijob.bash
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
bash -o monitor -O lastpipe /dev/fd/3 3<<\EOF | |
typeset -A j jobs | |
n=0 | |
while ((n++ < 3)); do | |
{ set -m; trap "exit \$n" exit; suspend; } & | |
jobs+=([$!]=) | |
done | |
{ for x in "${!jobs[@]}"; do sleep .2; kill -CONT "$x"; done; } & | |
until wait -fnp jid "${!jobs[@]}" | |
(( (${jobs[$jid]+j[\$jid] = }$?) == 0)); do |
NewerOlder