diff --git a/CLAUDE.md b/CLAUDE.md index df7829c..be3f01c 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -1,6 +1,7 @@ ## Coding Style - Never write shebang unless specifically requested - Do not abuse comments when writing code, especially code intuitive enough that does not need comments to further explain +- When writing shell scripts, prefer zsh over bash; use `zsh -i -c` to run commands that need access to user-defined shell functions ## NixOS - This is my nixOS configuration for all my personal computers, and you are running on one of the nixOS hosts diff --git a/modules/seq-command.nix b/modules/seq-command.nix index 98d1c8d..edeaf44 100644 --- a/modules/seq-command.nix +++ b/modules/seq-command.nix @@ -41,12 +41,13 @@ let while [[ -s "$file" ]]; do cmd="$(head -n 1 "$file")" - tail -n +2 "$file" > "$file.tmp" && mv "$file.tmp" "$file" if [[ -n "$cmd" ]]; then - eval "$cmd" + zsh -i -c "$cmd" fi + tail -n +2 "$file" > "$file.tmp" && mv "$file.tmp" "$file" + if [[ -s "$file" ]]; then sleep "$gap_seconds" fi