{"id":17048527,"url":"https://github.com/hollasch/csub","last_synced_at":"2025-07-07T01:36:28.116Z","repository":{"id":68064564,"uuid":"121358476","full_name":"hollasch/csub","owner":"hollasch","description":"Command substitution for the Windows command shell","archived":false,"fork":false,"pushed_at":"2025-05-10T19:04:53.000Z","size":45,"stargazers_count":3,"open_issues_count":1,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-05-10T20:18:47.653Z","etag":null,"topics":["command-line","command-substitution","exe","windows"],"latest_commit_sha":null,"homepage":null,"language":"C++","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/hollasch.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-02-13T08:40:58.000Z","updated_at":"2025-05-10T19:04:56.000Z","dependencies_parsed_at":"2025-01-28T10:39:47.119Z","dependency_job_id":null,"html_url":"https://github.com/hollasch/csub","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/hollasch/csub","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hollasch%2Fcsub","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hollasch%2Fcsub/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hollasch%2Fcsub/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hollasch%2Fcsub/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hollasch","download_url":"https://codeload.github.com/hollasch/csub/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hollasch%2Fcsub/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261528653,"owners_count":23172749,"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","command-substitution","exe","windows"],"created_at":"2024-10-14T09:52:16.042Z","updated_at":"2025-06-23T18:05:32.776Z","avatar_url":"https://github.com/hollasch.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"csub\n====================================================================================================\nCommand Substitution for the Windows Command Shell\n\n\nSummary\n--------\nMost Unix-like shells support a technique called _command substitution_: a way to use the output of\none command in the middle of another command. The Windows standard shell (command prompt) lacks this\nability, but the `csub` command provides a simple way to mock this for most situations.\n\n\nUsage\n------\n    csub [--help|-h|/?] \u003ccommand\u003e [\u003cstrings\u003e] [`\u003ccommand\u003e`] [\u003cstrings\u003e] [`\u003ccommand\u003e`] …\n\n\nDescription\n------------\nIn most shells, one can accomplish command substitution by quoting a command with backquotes like\nso:\n\n```sh\n\u003e echo It's a fine day in `hostname`-land.\nIt's a fine day in mycomputer03-land.\n```\n\nIn other shells, like Bash, you can also accomplish this by enclosing the command in `$(…)`, like\nthis:\n\n```sh\n\u003e echo It's a fine day in $(hostname)-land.\nIt's a fine day in mycomputer03-land.\n```\n\nThe `csub` command provides a way to do this in the Windows command shell — anything in the `csub`\narguments between backquotes is executed and replaced with the output, like so:\n\n```sh\nC:\\\u003e csub echo It's a fine day in `hostname`-land.\nIt's a fine day in mycomputer03-land.\n```\n\n\nLimitations\n------------\n\n### `csub` cannot change the environment at the calling level\nThe `csub` command is executed inside its own context, so commands that would change the environment\ncannot change the environment of the caller. For example,\n\n```sh\nC:\\qux\\baz\\frotz\u003e csub cd `echo \\qux`\n\nC:\\qux\\baz\\frotz\u003e\n```\n\nIn the above example, you'd like the current directory to be `C:\\qux` after running the command. The\n`csub` command _does_ change the directory, but only it its own environment; it does not change the\nenvironment at the calling level.\n\n\nBuilding\n---------\nThis project uses the CMake build tool. CMake is a meta-build system that locates and uses your\nlocal development tools to build the project if possible.\n\nTo build, first install [CMake][https://cmake.org/]. Then go to the project root directory and run\nthe following command:\n\n    cmake -B build\n\nThis will locate your installed development tools and configure your project build in the `build/`\ndirectory. After that, whenever you want a new build, run this command:\n\n    cmake --build build\n\nThis will build a debug version of the project, located in `build/Debug/`. To build a release\nversion, run\n\n    cmake --build build --config release\n\nYou can find the built release executable in `build/Release/`.\n\n\nInstallation\n-------------\nThe built executable is `csub.exe`, and can be copied anywhere to your command path. There is no\nWindows installation required for this tool.\n\n\n----------------------------------------------------------------------------------------------------\nSteve Hollasch, steve@hollasch.net\u003cbr\u003e\nhttps://github.com/hollasch/csub\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhollasch%2Fcsub","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhollasch%2Fcsub","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhollasch%2Fcsub/lists"}