{"id":18611601,"url":"https://github.com/twosigma/relexec","last_synced_at":"2026-06-20T04:32:09.111Z","repository":{"id":51353831,"uuid":"366750970","full_name":"twosigma/relexec","owner":"twosigma","description":"A program to enable relative shebangs in scripts","archived":false,"fork":false,"pushed_at":"2025-12-28T13:32:42.000Z","size":24,"stargazers_count":2,"open_issues_count":5,"forks_count":1,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-12-31T01:26:19.202Z","etag":null,"topics":["scripts","unix"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/twosigma.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-05-12T14:49:28.000Z","updated_at":"2025-12-28T13:32:46.000Z","dependencies_parsed_at":"2022-09-24T21:41:56.366Z","dependency_job_id":null,"html_url":"https://github.com/twosigma/relexec","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/twosigma/relexec","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/twosigma%2Frelexec","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/twosigma%2Frelexec/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/twosigma%2Frelexec/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/twosigma%2Frelexec/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/twosigma","download_url":"https://codeload.github.com/twosigma/relexec/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/twosigma%2Frelexec/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34557551,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-20T02:00:06.407Z","response_time":98,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","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":["scripts","unix"],"created_at":"2024-11-07T03:14:22.786Z","updated_at":"2026-06-20T04:32:09.094Z","avatar_url":"https://github.com/twosigma.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Relexec\n\n![GitHub Workflow Status](https://img.shields.io/github/workflow/status/twosigma/relexec/Run%20tests)\n![GitHub](https://img.shields.io/github/license/twosigma/relexec)\n\n`relexec` is a helper program to enable \"relative shebangs\".\n\nRelative shebangs are not natively supported on POSIX systems. Paths specified\nas relative in shebangs are resolved relative to the current working directory,\nbehaviour which is almost useless.\n\nTo work around this, a shebang can be specified with the `relexec` program,\ninstalled in a well-known path. `relexec` constructs a path relative to the\nscript and execs it.\n\nThis allows scripts to be defined that run with interpreters installed with the\nscript. These can then run from anywhere in the filesystem, or be moved to\nanother location without breaking (as long as the relative path between the\nscript and interpreter does not change).\n\nUnlike other solutions to this problem, it is easy to programmatically rewrite\nshebangs to use relexec (or rewrite them back).\n\n\n## Usage\n\nThe intended usage is in the shebang line of a script:\n\n```\n#!/usr/lib/relexec python3.9\n\u003cPython 3.9 code\u003e\n```\n\nwhich would define that the script should be executed with an executable\nnamed `python3.9` in the same directory as the script.\n\nSpecifically, if the script is in `/path/to/file`, then executing\n`/path/to/file arg1 arg2` would run relexec with this command line:\n\n```\n/usr/lib/relexec python3.9 /path/to/file arg1 arg2\n```\nwhich relexec transforms to\n\n```\n/path/to/python3.9 /path/to/file arg1 arg2\n```\n\nand `exec()`s the result.\n\n\n## Installation\n\nWe provide C, Rust, and for reference, Python versions of `relexec`.\n\nWe specify that the `relexec` binary, if installed, must be installed to\n`/usr/lib/relexec` so that this path can be hard coded in shebangs.\n\n`/usr/lib` is the appropriate place for internal binaries according to the\n[Filesystem Hierarchy Standard 3.0](https://refspecs.linuxfoundation.org/FHS_3.0/fhs/ch04s06.html),\nas `/usr/libexec` does not exist on all systems.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftwosigma%2Frelexec","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftwosigma%2Frelexec","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftwosigma%2Frelexec/lists"}