Our great sponsors
-
bash-cache
Transparent caching layer for bash functions; particularly useful for functions invoked as part of your prompt.
-
InfluxDB
Power Real-Time Data Analytics at Scale. Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.
Is the goal of your cache function to cache a command if it's been run before? If so you might like to use my bash-cache library :) Even if it's not quite what you're looking for you can poke around the code for some inspiration, it implements a function decorator pattern and demonstrates some hairy uses of eval.
Alternatively, check out bkt (also mine), which is like bash-cache but for subprocesses instead of shell functions.
Related posts
- New release of bkt, a subprocess caching utility
- Cdpath: Easily Navigate Directories in the Terminal
- Atuin replaces your existing shell history with a SQLite database
- [Media] shrs: a shell that is configurable and extensible in rust
- Why is it that a command run from the terminal command line produces line break but the same command run within bash script has no line break/