Skip to content

feat: Enable || && and ; to function properly inside the shell - #45

Merged
Aleksandergreg merged 1 commit into
mainfrom
feat/shell-lists-and-fidelity
Oct 10, 2026
Merged

Aleksandergreg merged 1 commit into
mainfrom
feat/shell-lists-and-fidelity

Conversation

@Aleksandergreg

Copy link
Copy Markdown
Owner
  • They behave like sh: && and || bind equally from left to right, and ls /nope || echo fallback shows the error and then fallback.
  • Each command expands variables and globs when its turn comes, so export X=1; echo $X prints 1 and cd logs && ls * lists the new directory.
  • The whole line is checked before anything runs, so a syntax error late in the line changes nothing. vi can't be used inside a list.
  • Lists also work in scripts. A failure handled by || is shown with its script line and the script carries on.
  • Exit status was needed to make this correct. grep with no match now fails silently, so grep -q ERROR log && echo alert works. I added grep -q, true and false; the last two don't count toward the Command Collector achievement. A plain grep with no match on its own line behaves exactly as before.
  • When a list's last command fails, the mission is still checked, because earlier commands may already have changed things.

sort f > f empties the file, as on Linux. One deliberate difference: if the command fails, the file is put back. An existing safety test requires that a rejected command never destroys data, and AGENTS.md says not to weaken that, so I kept it.

Ranks: I added Staff SRE (1,600 XP), Principal SRE (2,150) and Distinguished Engineer (2,700) above Senior SRE. The existing thresholds didn't change, so nobody gets demoted. Your own profile at 1,201 XP stays Senior SRE and is 399 XP from the next rank. A new test checks that finishing Linux reaches Staff SRE and the full catalog reaches the top rank.

Smaller fixes:

  • ls: named files are listed first, as typed. Directories come after with headers, -a shows . and .., and a hidden file you name explicitly is shown.
  • Globs: * no longer matches hidden files, though .* does. find still matches them, as on Linux.
  • cut: field lists like -f1,3, 2- and -2 work. Lines without the delimiter pass through whole, -s is new, and multi-character delimiters are rejected.
  • find: repeated tests now all have to match. -o and ! give a clear "not supported" error.

- They behave like sh: && and || bind equally from left to right, and ls /nope || echo fallback shows the error and then fallback.
- Each command expands variables and globs when its turn comes, so export X=1; echo $X prints 1 and cd logs && ls * lists the new directory.
- The whole line is checked before anything runs, so a syntax error late in the line changes nothing. vi can't be used inside a list.
- Lists also work in scripts. A failure handled by || is shown with its script line and the script carries on.
- Exit status was needed to make this correct. grep with no match now fails silently, so grep -q ERROR log && echo alert works. I added grep -q, true and false; the last two don't count toward the Command Collector achievement. A plain grep with no match on its own line behaves exactly as before.
- When a list's last command fails, the mission is still checked, because earlier commands may already have changed things.

sort f > f empties the file, as on Linux. One deliberate difference: if the command fails, the file is put back. An existing safety test requires that a rejected command never destroys data, and AGENTS.md says not to weaken that, so I kept it.

Ranks: I added Staff SRE (1,600 XP), Principal SRE (2,150) and Distinguished Engineer (2,700) above Senior SRE. The existing thresholds didn't change, so nobody gets demoted. Your own profile at 1,201 XP stays Senior SRE and is 399 XP from the next rank. A new test checks that finishing Linux reaches Staff SRE and the full catalog reaches the top rank.

Smaller fixes:
- ls: named files are listed first, as typed. Directories come after with headers, -a shows . and .., and a hidden file you name explicitly is shown.
- Globs: * no longer matches hidden files, though .* does. find still matches them, as on Linux.
- cut: field lists like -f1,3, 2- and -2 work. Lines without the delimiter pass through whole, -s is new, and multi-character delimiters are rejected.
- find: repeated tests now all have to match. -o and ! give a clear "not supported" error.
@Aleksandergreg Aleksandergreg changed the title Command lists (;, &&, ||) feat: Enable || && and ; to function properly inside the shell Oct 10, 2026
@Aleksandergreg
Aleksandergreg merged commit ce2e4a7 into main Oct 10, 2026
7 checks passed
@Aleksandergreg
Aleksandergreg deleted the feat/shell-lists-and-fidelity branch October 10, 2026 08:42
Aleksandergreg pushed a commit that referenced this pull request Oct 10, 2026
🤖 I have created a release *beep* *boop*
---


##
[0.11.0](v0.10.0...v0.11.0)
(2026-10-10)


### Features

* Enable || && and ; to function properly inside the shell
([#45](#45))
([ce2e4a7](ce2e4a7))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant