Recently Written · git

tmpl

Insanely simple templates

git clone https://github.com/equwal/tmpl

Log | Files | Refs


commit b14705b5ad0a43a62c80177a9f498573905e247f
Spenser Truex <truex@equwal.com>
2025-09-08 21:46:30 -0700

Add POSIX pushd/popd fix

 sh/pushd-popd-directory-switch | 13 ++++++++++---
 1 file changed, 10 insertions(+), 3 deletions(-)
diff --git a/sh/pushd-popd-directory-switch b/sh/pushd-popd-directory-switch
index 1c15f05..d5224e3 100644
--- a/sh/pushd-popd-directory-switch
+++ b/sh/pushd-popd-directory-switch
@@ -1,6 +1,13 @@
 # LLM generated this genius thing for a Makefile uninstaller
 # pushd build && rm -f file1 file2 ; popd
 
-pushd
-<++>
-popd
+# not posix
+# pushd <++>
+# <++>
+# popd
+
+# posix: use a subshell for fake pushd/popd
+( # pushd
+  cd <++>
+  <++>
+) # popd