Batsh
Queue bash commands to run with a given concurrency
Install / Use
/learn @jwerle/BatshREADME
batsh(1)
Queue bash commands to run with a given concurrency. Similar to
batch(1) without the crap
install
$ bpkg install jwerle/batsh
usage
usage: batsh [-hV]
or: batsh push <script>
or: batsh run [script]
or: batsh clear
or: batsh reset
or: batsh concurrency <n>
batsh(1) allows the user to queue jobs that will run with a set
concurrency (Default 0). Jobs are pushed with batsh push onto
a queue and are ran with batsh run. The queue can be cleared with
batsh clear.
push
Jobs that are pushed are just shell scripts that are invoked with the batsh jobs are ran.
$ batsh push 'echo beep'
run
Jobs are ran with batsh run which accepts optional code to be executed
when all jobs have completed. This command has an alias of batsh r.
$ batsh run 'echo done'
beep
done
concurrency
Concurrency can be set with batsh concurrency. It has an alias of
batsh c.
$ batsh concurrency 2
batsh instance
batsh(1) manages its state in a directory set with the BATSH
environment variable. The default is ${HOME}/.batsh. A user can manage
multiple batsh instances by settings this variable.
batch scripts
batsh(1) can run a script exposing a few helper functions. Batsh
script is just bash.
#!/usr/bin/env batsh
## jobs
push 'echo beep'
push 'echo boop'
push 'sleep 1 && echo beeps'
push 'sleep 1 && echo boops'
## set concurrency
concurrency 2
## run
run 'echo done'
license
MIT
Related Skills
node-connect
351.8kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
110.9kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
351.8kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
qqbot-media
351.8kQQBot 富媒体收发能力。使用 <qqmedia> 标签,系统根据文件扩展名自动识别类型(图片/语音/视频/文件)。
