2022-04-14 21:35:52 -07:00
|
|
|
#!/bin/sh
|
|
|
|
# Usage:
|
|
|
|
# cda <dirs>
|
2021-12-26 16:21:50 -08:00
|
|
|
|
2022-04-14 21:35:52 -07:00
|
|
|
# cd all: opens a new shell in each of the passed dirs
|
|
|
|
|
|
|
|
# Ideas for improvement:
|
2021-12-26 16:21:50 -08:00
|
|
|
# - somehow record typed commands so they can be automatically repeated like a macro
|
|
|
|
# - maybe get the length of the histfile before and after, executing the last X number of commands
|
|
|
|
# - Maybe just add an argument that takes a command and executes it in all dirs
|
|
|
|
# (although that wouldn't be as good as recording actions bc it's easy to do
|
|
|
|
# that by just writing a for loop)
|
|
|
|
|
2022-01-01 18:24:20 -08:00
|
|
|
cda() {
|
2022-04-14 21:35:52 -07:00
|
|
|
for DIR in "$@"; do
|
|
|
|
echo
|
|
|
|
echo "$DIR"
|
|
|
|
(cd "$DIR" && $SHELL)
|
2022-01-01 18:24:20 -08:00
|
|
|
done
|
2022-04-14 21:35:52 -07:00
|
|
|
echo "$0: done"
|
2022-01-01 18:24:20 -08:00
|
|
|
}
|
2021-12-26 16:21:50 -08:00
|
|
|
|