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 -S-- BASH_COMPAT=51 bash -O lastpipe -O extglob -O expand_aliases +O assoc_expand_once +O sourcepath | |
typeset x | |
x=$(pkgconf --var=loadablesdir bash) && | |
[[ ! $BASH_LOADABLES_PATH =~ (^|:)"$x"($|:) ]] && | |
BASH_LOADABLES_PATH+=${BASH_LOADABLES_PATH:+:}${x} | |
for x in asort mktemp | |
do enable -f "$x"{,} || exit | |
done |
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)ormaaj 65 (2713681) 2 ~ $ function f { unset -f f; typeset -ia fd; typeset -n fdn=fd[\${#fd[@]}]; { env -- BASH_FUNC_pre_pkg_{pretend,setup}'%%=() { function tc-check-openmp { return 0; }; }' execlineb -- "/proc/self/fd/${fd[0]}" "${fd[@]}"; } {fdn}<<\EOF {fdn}<<\EOF; typeset x; for x in "${fd[@]}"; do exec {x}<&-; done; }; f | |
fdreserve 1 | |
multisubstitute { | |
importas -iu f0 FD0 | |
elgetpositionals | |
} | |
emptyenv -P | |
fdclose $1 | |
define -sd " " v "${2} ${f0}" | |
creatememfd $f0 "" |
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
\unset -v aliasrestore | |
aliasrestore=$(\alias -p) aliasrestore+=${aliasrestore:+$'\n\\'unset -v aliasrestore} | |
\unalias -a | |
function setupGlobalAliases { | |
\alias \-- \ | |
'--=-- ' \ | |
'l-=local -' \ | |
'fn=function ' \ | |
'ts=typeset' \ |
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/false | |
\typeset -a bool; bool+=([1]=) | |
\typeset -n sh_file | |
\test -v KSH_VERSION | |
sh_file=${bool[$?]+bash_source[0]}${bool[!$?]+.sh.file} | |
dotFilesPath=$(\findmnt -umlnfo target -O subvol=/vol/dotfiles "PARTUUID=$(\findmnt -umlnfo partuuid -T /)") | |
[[ $sh_file == ?(*/)shell ]] | |
\source -- ${bool[!$?]+"$sh_file"}${bool[$?]+"${dotFilesPath}/common/home/shell"}/functions | |
rc_main "$@" |
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 f { lsfd -np "$BASHPID" --summary=only -C ' :ASSOC == "mem"'; }; typeset -fx f; f; bash -ic 'f; type -t print; print -r :\); type -t print; f; print -r :D'; } | tr -s '\n ' ' '; echo | |
247 31 function :) builtin 36 :D |
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 bash | |
typeset -ga bool=([1]=) | |
# Usage: in_array name outvar | |
function fmtarr { | |
typeset x=1 y max ret=$3 | |
printf -v "$ret" '%s+=(' "$2" | |
eval -- set -- "\"\${!${1}[@]}\"" "\"\${${1}[@]}\"" || return | |
((max = $# / 2)) |
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 mapfile { | |
typeset x IFS REPLY OPTARG OPTIND=1 | |
typeset -A ind opts=([c]=5000) | |
integer ind o | |
for x; do | |
getopts :d:n:O:s:u:C:c:t x || break | |
case $x in | |
\?|:) return 1 ;; | |
*) opts[$x]=$OPTARG ind[$x]=OPTIND |
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 expand_aliases | |
shopt -u assoc_expand_once | |
BASH_COMPAT=51 | |
typeset -a bool=([1]=) | |
function unset2 { command unset "$@"; } | |
function mkTranslucentFunctions { | |
typeset -a builtins |
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
# Define a new type "SslCmd" with three fields: "outfile", "args", and "cmd". "cmd" has a default value of "openssl" that can be overridden by an object initializer list. | |
# The type defines a public method named "run". | |
# The result of this declaration is a new declaration command "SslCmd" that can be used in place of "typeset". | |
typeset -T SslCmd=( | |
typeset -h 'output file' outfile | |
typeset -h 'arguments passed to the command name passed to _.run' -a args | |
typeset -h 'The command to run' cmd=openssl | |
# A method associated with each instance that runs the command and associated args. | |
# _ (in this context) is a pointer to the instance, similar to "this" or "self". |
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 | |
# ormaaj's init | |
\unalias -a | |
shopt -s lastpipe extglob expand_aliases | |
shopt -u assoc_expand_once | |
typeset -ga bool=([1]=) | |
function initializeBuiltins { | |
typeset -a a |
NewerOlder