{"id":16803278,"url":"https://github.com/sjmulder/within","last_synced_at":"2025-07-22T15:33:59.360Z","repository":{"id":136507433,"uuid":"155925064","full_name":"sjmulder/within","owner":"sjmulder","description":"Run a command in other directories","archived":false,"fork":false,"pushed_at":"2021-07-25T23:46:10.000Z","size":34,"stargazers_count":10,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-11T00:42:02.840Z","etag":null,"topics":["c","cli","shell","unix"],"latest_commit_sha":null,"homepage":null,"language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-2-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sjmulder.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.md","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-11-02T21:49:43.000Z","updated_at":"2024-10-09T02:07:21.000Z","dependencies_parsed_at":"2024-08-14T02:33:20.676Z","dependency_job_id":null,"html_url":"https://github.com/sjmulder/within","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/sjmulder/within","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sjmulder%2Fwithin","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sjmulder%2Fwithin/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sjmulder%2Fwithin/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sjmulder%2Fwithin/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sjmulder","download_url":"https://codeload.github.com/sjmulder/within/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sjmulder%2Fwithin/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266520995,"owners_count":23942369,"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","status":"online","status_checked_at":"2025-07-22T02:00:09.085Z","response_time":66,"last_error":null,"robots_txt_status":null,"robots_txt_updated_at":null,"robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["c","cli","shell","unix"],"created_at":"2024-10-13T09:42:12.253Z","updated_at":"2025-07-22T15:33:59.108Z","avatar_url":"https://github.com/sjmulder.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"within\n======\n[![Build status](\n https://builds.sr.ht/~sjmulder/within.svg)](\n https://builds.sr.ht/~sjmulder/within)\n\nRun a command in other directories:\n\n**within** [**-j** *jobs*] *directories* **-** *command*\n\nDescription\n-----------\nRuns the given *command* in all given *directories*,\nprepending directory names to output:\n\n    $ within msort trickle - make clean\n    msort: rm -f *.o msort\n    trickle: rm -f trickle tritty\n\nWhen a single directory is given the **--** may be omitted:\n\n    $ within code/msort git status\n    code/msort: nothing to commit, working tree clean\n\nThe **-j** option specifies how many commands may be run simultaneously.\nThe default is 1.\n\nImplementation\n--------------\nBased around a select() event loop. As many jobs are started as **-j** allows\n(1 by default), forking, descending into the given directory and executing\nthe command. For each job, both standard output and standard error are\nredirected to a pipe that's read by a 'piper' which adds the 'directory:'\nprefixes to the output. These pipers are effectively coroutines.\n\nThe event loop waits for finished jobs, starting new ones if there are\ndirectories left, and for data on the pipes.\n\nThe select() specific code should be fairly easy to swap out. Point in\ncase, originally kqueue was used.\n\nRunning\n-------\nShould work with any Unix, including Linux and macOS.\n\nMac users can install from\n[my Homebrew tap](https://github.com/sjmulder/homebrew-tap)\n\n    brew install sjmulder/tap/within\n\nTo compile, install and uninstal from source:\n\n    make\n    make install   [DESTDIR=] [PREFIX=/usr/local] [MANPREFIX=PREFIX/man]\n    make uninstall [DESTDIR=] [PREFIX=/usr/local] [MANPREFIX=PREFIX/man]\n\nAuthor\n------\nSijmen J. Mulder (\u003cik@sjmulder.nl\u003e)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsjmulder%2Fwithin","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsjmulder%2Fwithin","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsjmulder%2Fwithin/lists"}