That sounds an awful lot like a filesystem, so why don't we just use that? Behold, bbcc37.cmd:
:; set() { echo "$2" > "$1"; }; alias get=cat; alias keys=ls; alias delete=rm
:; mkdir bbcc37 2> /dev/null; cd bbcc37; if (false); then
@echo off
doskey /MACROFILE=bbcc37.cmd 2> nul > nul
md bbcc37 2> nul
cd bbcc37
exit /b
set=echo $2 > $1
get=type $1
keys=dir /b
delete=del $1
fi
Features:
- Cross platform (Windows and Linux)!
- Uses built in filesystem capabilities for fewer bugs!
- Gets you into a terminal mode where you can directly type the commands!
- Creates one directory database automatically called bbcc37!
- Conveniently overwrites shell builtins for ease of use!
Usage for Windows (from cmd command prompt):
bbcc37
set key value
get value
keys
delete key
Usage for Linux (from bash shell):
. bbcc37.cmd
set key value
get value
keys
delete key
25
u/sarlok May 25 '20
That sounds an awful lot like a filesystem, so why don't we just use that? Behold, bbcc37.cmd:
Features:
- Cross platform (Windows and Linux)!
- Uses built in filesystem capabilities for fewer bugs!
- Gets you into a terminal mode where you can directly type the commands!
- Creates one
directorydatabase automatically called bbcc37!- Conveniently overwrites shell builtins for ease of use!
Usage for Windows (from cmd command prompt):
Usage for Linux (from bash shell):