Ever burned a cake?
Go to file
2024-09-28 23:06:05 +00:00
.gitignore merge cbake/balex 2024-09-27 03:13:43 +00:00
bake.1 document and clean 2024-09-28 23:06:05 +00:00
bake.l document and clean 2024-09-28 23:06:05 +00:00
install.sh merge cbake/balex 2024-09-27 03:13:43 +00:00
README document and clean 2024-09-28 23:06:05 +00:00
shake merge cbake/balex 2024-09-27 03:13:43 +00:00
test.a.txt @RECURS, @ARGS:N+ 2024-09-28 22:13:54 +00:00

--- README

A tool to run embedded scripts.

Bootstrap with ./shake bake.l
then compile further with ./bake,
install by running ./install.sh

---

bake [-chln] [-s <n>] <FILENAME> [ARGS...]; version 20240927

Bake is a simple tool meant to execute embedded shell commands within
any file.  It executes with /bin/sh the command after a "@BAKE " to
the end of the line (a UNIX newline: '\n').

It expands some macros,
  @FILENAME @FILE @NAME - filename
  @SHORT                - filename without suffix (abc.x.txt \-> abc.x)
  @SHORT:N              - removes N suffixes, so (a.b.c 2 -> a)
  @ARGS                 - other arguments to the program
  @ARGS:N               - Provides the Nth argument, starting from 0
  @ARGS:N+              - All arguments at and after Nth
  @RECURS               - the full path name to the executable
  @LINE                 - line number at the selected @BAKE

All macros can be exempted by prefixing them with a backslash,
which'll be subtracted in the expansion. commands may be
spanned over several lines with a leading backslash.

It has five options, this message (-h, --help); prevents the execution
of the shell command (-n, --dry-run); list (-l, --list) and select
(-s<n>, --select <n>) which respectively lists all @BAKE commands and
select & run the Nth command.

It roots the shell execution in the directory of the given file.

Licensed under the public domain.

---

Shake

Bake was inspired by the Bash-based Shake utility (formerly eMake, he
liked my suggestion for a name).  It is included under authorization
of its creator.  The original version of Shake may be found at:
<http://bis64wqhh3louusbd45iyj76kmn4rzw5ysawyan5bkxwyzihj67c5lid.onion/anon/shake>

Bake includes a modified Shake, both after installation and as a
bootstrapper.  The modified version includes all features of Bake with
the exceptions of multi-line commands.  It is not a general
replacement for Bake.

Changelog

Bake was created on 2023/09/13, and complete as of 2024/03/02.

2024-09-27

Lex. As adviced by the original creator, I learned and implemented a
Bake with lex. Removes facilitated expunge and color, may be rectified.