Skip to contentSkip to conversation

builtin: add source for Bash compat

PATCH In review Eduardo Santos 2 participants 2 messages Aug 28, 2025 – Sep 14, 2025

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 builtin: add source for Bash compat

Do not merge this patch; it is purely informational.

I tried using DASH in a container image for GitLab CI/CD [1] but the runner expects the source special builtin from Bash to be available. This one-liner fixed it for me.

[1] https://docs.gitlab.com/runner/configuration/advanced-configuration/#use-a-posix-compliant-shell

---
 src/builtins.def.in | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
src/builtins.def.in +1 -1
index 95e420c..7a7d68a 100644
@@ -61,7 +61,7 @@ histcmd		-u fc
 breakcmd	-s break -s continue
 cdcmd		-u cd chdir
 commandcmd	-u command
-dotcmd		-s .
+dotcmd		-s . -s source
 echocmd		echo
 evalcmd		-ns eval
 execcmd		-s exec
Signature · 1 line
2.51.0
#1 lore raw

FWIW, this can also be done with a function inside the shell itself :)

	source () {
		. "$@"
	}

...hopefully I used the correct special parameter and quotes, but in most cases you can probably just use $1 and be fine.

Signature · 1 line
S.