{"id":13823612,"url":"https://github.com/michaelmacinnis/oh","last_synced_at":"2025-05-16T06:05:51.265Z","repository":{"id":1505307,"uuid":"1761049","full_name":"michaelmacinnis/oh","owner":"michaelmacinnis","description":"A new Unix shell.","archived":false,"fork":false,"pushed_at":"2023-09-19T17:46:30.000Z","size":2159,"stargazers_count":1374,"open_issues_count":4,"forks_count":55,"subscribers_count":38,"default_branch":"main","last_synced_at":"2025-04-08T16:01:50.971Z","etag":null,"topics":["command-line","concurrent","functional","interpreter","language","scheme","scripting-language","shell","unix"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/michaelmacinnis.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":"AUTHORS","dei":null,"publiccode":null,"codemeta":null},"funding":{"github":"michaelmacinnis","patreon":"user?u=20026503"}},"created_at":"2011-05-17T14:21:33.000Z","updated_at":"2025-04-02T16:57:08.000Z","dependencies_parsed_at":"2024-06-18T17:04:01.212Z","dependency_job_id":"94c05190-cbbf-4644-a71f-b8ca55c3abd2","html_url":"https://github.com/michaelmacinnis/oh","commit_stats":{"total_commits":1033,"total_committers":3,"mean_commits":344.3333333333333,"dds":0.06969990319457886,"last_synced_commit":"61bd14f0578341d966b457f727ebfce43ae9c230"},"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/michaelmacinnis%2Foh","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/michaelmacinnis%2Foh/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/michaelmacinnis%2Foh/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/michaelmacinnis%2Foh/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/michaelmacinnis","download_url":"https://codeload.github.com/michaelmacinnis/oh/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254478188,"owners_count":22077676,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["command-line","concurrent","functional","interpreter","language","scheme","scripting-language","shell","unix"],"created_at":"2024-08-04T09:00:38.285Z","updated_at":"2025-05-16T06:05:46.254Z","avatar_url":"https://github.com/michaelmacinnis.png","language":"Go","readme":"# Oh, a new Unix shell\n\n## Why oh?\n\nOh is a reimagining of the Unix shell.\n\nOh provides:\n\n- A simplified set of evaluation and quoting rules;\n- Rich return values that work with standard shell constructs;\n- First-class channels, pipes, environments and functions;\n- A list type (no word splitting);\n- Support for modularity;\n- Lexical scope;\n- Exceptions;\n- Kernel-style fexprs (allowing the definition of new language constructs); and\n- A syntax that deviates as little as possible from established conventions;\n\nOh was motivated by the belief that many of the flaws in current Unix shells\nare not inherent but rather historical. Design choices that are now clearly\nunfortunate in retrospect have been carried forward in the name of backward\ncompatibility.\n\nOh's goal is a language that is not only more powerful and more regular but\none that respects the conventions established by the Unix shell over the last\nhalf-century.\n\n## Getting started\n\n### Installing\n\nThe easiest way to try oh is to download a precompiled binary.\n\n\n#### DragonFly BSD\n\n[amd64](https://github.com/michaelmacinnis/oh/releases/download/v0.8.3/oh-v0.8.3-dragonfly-amd64)\n\n#### FreeBSD\n\n[386](https://github.com/michaelmacinnis/oh/releases/download/v0.8.3/oh-v0.8.3-freebsd-386), [amd64](https://github.com/michaelmacinnis/oh/releases/download/v0.8.3/oh-v0.8.3-freebsd-amd64), [arm](https://github.com/michaelmacinnis/oh/releases/download/v0.8.3/oh-v0.8.3-freebsd-arm), [arm64](https://github.com/michaelmacinnis/oh/releases/download/v0.8.3/oh-v0.8.3-freebsd-arm64), [riscv64](https://github.com/michaelmacinnis/oh/releases/download/v0.8.3/oh-v0.8.3-freebsd-riscv64)\n\n#### illumos\n\n[amd64](https://github.com/michaelmacinnis/oh/releases/download/v0.8.3/oh-v0.8.3-illumos-amd64)\n\n#### Linux\n\n[386](https://github.com/michaelmacinnis/oh/releases/download/v0.8.3/oh-v0.8.3-linux-386), [amd64](https://github.com/michaelmacinnis/oh/releases/download/v0.8.3/oh-v0.8.3-linux-amd64), [arm](https://github.com/michaelmacinnis/oh/releases/download/v0.8.3/oh-v0.8.3-linux-arm), [arm64](https://github.com/michaelmacinnis/oh/releases/download/v0.8.3/oh-v0.8.3-linux-arm64), [mips](https://github.com/michaelmacinnis/oh/releases/download/v0.8.3/oh-v0.8.3-linux-mips), [mips64](https://github.com/michaelmacinnis/oh/releases/download/v0.8.3/oh-v0.8.3-linux-mips64), [mips64le](https://github.com/michaelmacinnis/oh/releases/download/v0.8.3/oh-v0.8.3-linux-mips64le), [mipsle](https://github.com/michaelmacinnis/oh/releases/download/v0.8.3/oh-v0.8.3-linux-mipsle), [ppc64](https://github.com/michaelmacinnis/oh/releases/download/v0.8.3/oh-v0.8.3-linux-ppc64), [ppc64le](https://github.com/michaelmacinnis/oh/releases/download/v0.8.3/oh-v0.8.3-linux-ppc64le), [riscv64](https://github.com/michaelmacinnis/oh/releases/download/v0.8.3/oh-v0.8.3-linux-riscv64), [s390x](https://github.com/michaelmacinnis/oh/releases/download/v0.8.3/oh-v0.8.3-linux-s390x)\n\n#### macOS\n\n[amd64](https://github.com/michaelmacinnis/oh/releases/download/v0.8.3/oh-v0.8.3-darwin-amd64), [arm64](https://github.com/michaelmacinnis/oh/releases/download/v0.8.3/oh-v0.8.3-darwin-arm64)\n\n#### OpenBSD\n\n[386](https://github.com/michaelmacinnis/oh/releases/download/v0.8.3/oh-v0.8.3-openbsd-386), [amd64](https://github.com/michaelmacinnis/oh/releases/download/v0.8.3/oh-v0.8.3-openbsd-amd64), [arm](https://github.com/michaelmacinnis/oh/releases/download/v0.8.3/oh-v0.8.3-openbsd-arm), [arm64](https://github.com/michaelmacinnis/oh/releases/download/v0.8.3/oh-v0.8.3-openbsd-arm64)\n\n#### Solaris\n\n[amd64](https://github.com/michaelmacinnis/oh/releases/download/v0.8.3/oh-v0.8.3-solaris-amd64)\n\nYou can also build oh from source. With Go 1.21 or later installed, type,\n\n    go install github.com/michaelmacinnis/oh@v0.8.3\n\n### Configuring\n\nWhen oh starts, it attempts to read a file called `.oh-rc` in the home\ndirectory of the current user. You can override this path by setting\nthe OH_RC environment variable to the full path of an alternative file\nbefore invoking oh.\n\nThe oh rc file is useful for setting environment variables and defining\ncustom commands. It's also a good place to override oh's default prompt.\nThe command below replaces oh's default prompt method with one that\ndisplays the current date.\n\n    replace-make-prompt (method (suffix) {\n        return `(date)$suffix\n    })\n\nOh (thanks to peterh/liner) also provides a searchable command history.\nBy default, this history is stored in a file called `.oh-history` in\nyour home directory. You can override this by setting the OH_HISTORY\nenvironment variable to the full path of an alternative file before\ninvoking oh.\n\n## Comparing oh to other Unix shells\n\nOh is a Unix shell. If you've used other Unix shells, oh should feel\nfamiliar. Below are some specific differences you may encounter.\n\n### Clobbering\n\nWhen redirecting output oh will not overwrite an existing file. To force\noh to overwrite (clobber) an existing file add a pipe, `|`, character\nimmediately after the redirection operator. For example,\n\n    command \u003e| out.txt\n\nOh's pipe and redirection syntax is as follows.\n\n| Syntax    | Redirection                        |\n|----------:|:----------------------------------:|\n|    `\u003c`    | input-from                         |\n|    `\u003e`    | output-to                          |\n|    `\u003e\u0026`   | output-errors-to                   |\n|    `\u003e\u0026\\|` | output-errors-clobbers             |\n|    `\u003e\u003e`   | append-output-to                   |\n|    `\u003e\u003e\u0026`  | append-output-errors-to            |\n|    `\u003e\\|`  | output-clobbers                    |\n|    `\\|`   | pipe-output-to                     |\n|    `\\|\u0026`  | pipe-output-errors-to              |\n|    `\\|\u003c`  | -named-pipe-input-from\u003csup\u003e*\u003c/sup\u003e |\n|    `\\|\u003e`  | -named-pipe-output-to\u003csup\u003e*\u003c/sup\u003e  |\n\n\\* - Used in process substitution.\n\n### Command substitution\n\nMany Unix shells support command substitution using the historical\nbacktick syntax,\n\n    `command`\n\nor the POSIX syntax,\n\n    $(command)\n\nOh has one syntax for command substitution,\n\n    `(command)\n\nThis syntax is both nestable and unambiguous.\n\n### Here documents\n\nOh does not have here documents. It does however allow strings to span\nlines and provides a `here` command that takes a string argument and can\nbe used to the same effect. For example,\n\n    # Build oh for supported BSD platforms\n    here \"\n    dragonfly amd64\n    freebsd 386\n    freebsd amd64\n    freebsd arm\n    freebsd arm64\n    openbsd 386\n    openbsd amd64\n    openbsd arm\n    openbsd arm64\n    openbsd mips64\n    \" | mill (o a) {\n        echo ${o}/${a}\n        GOOS=${o} GOARCH=${a} go build -o oh-latest-${o}-${a}\n    }\n\n### Variables\n\nTo introduce a new variable, use the `define` command,\n\n    define x 3\n\nTo introduce a variable that will be visible to external processes,\nuse the `export` command,\n\n    export GOROOT /usr/local/go\n\nTo set the value of an existing variable, use the `set` command,\n\n    set x 4\n\n### Variables and implicit concatenation\n\nLike other shells, oh implicitly concatenates adjacent string/symbol\nvalues. Unlike other shells, oh allows a larger set of characters to\nappear in variable names. In addition to letters, numbers, and the\nunderscore character, the following characters,\n\n    '!', '%', '*', '+', '-', '?', '[', ']',  and '^' \n\ncan be used in oh variable names. The command,\n\n    echo $set!\n\nwill cause oh to attempt to resolve a variable called `set!`. \nThe following characters,\n\n    ',', '.', '/', ':', '=', '@', and '~'\n\nalways result in a symbol of one character. This ensures that commands\nlike,\n\n    cd $PWD/$dir\n\nwork as expected. When using implicit concatentation, unexpected behavior\ncan be avoided by enclosing variable names in braces.\n\n### More detailed comparison\n\nFor a detailed comparison to other Unix shells see: [Comparing oh to other Unix Shells](https://htmlpreview.github.io/?https://raw.githubusercontent.com/michaelmacinnis/oh/master/doc/comparison.html)\n\n## Using oh\n\nFor more information on using oh, see: [Using oh](doc/manual.md)\n\n## Contributing to oh\n\nOh is an ongoing experiment and it needs your help. Try oh. Let me know\nwhat works for you and what doesn't.\n\nPull requests are welcome. For information on contributing, see: [CONTRIBUTING](CONTRIBUTING.md)\n\nYou can also sponsor me through GitHub Sponsors or Patreon.\n\n## License\n\n[MIT](LICENSE)\n\n","funding_links":["https://github.com/sponsors/michaelmacinnis","https://patreon.com/user?u=20026503"],"categories":["Go","Packages"],"sub_categories":["Shells"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmichaelmacinnis%2Foh","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmichaelmacinnis%2Foh","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmichaelmacinnis%2Foh/lists"}