{"id":22447179,"url":"https://github.com/tsubasaogawa/regex-replacing-tee","last_synced_at":"2025-08-24T14:18:53.333Z","repository":{"id":208457052,"uuid":"717092623","full_name":"tsubasaogawa/regex-replacing-tee","owner":"tsubasaogawa","description":"This is an extension of tee, a tool that performs replacements by regular expressions while writing text.","archived":false,"fork":false,"pushed_at":"2023-11-29T13:34:20.000Z","size":52,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-07-03T09:41:52.351Z","etag":null,"topics":["golang","regex","tee","text-processing"],"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/tsubasaogawa.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-11-10T14:41:22.000Z","updated_at":"2023-11-21T15:03:04.000Z","dependencies_parsed_at":"2023-11-29T14:44:45.622Z","dependency_job_id":null,"html_url":"https://github.com/tsubasaogawa/regex-replacing-tee","commit_stats":null,"previous_names":["tsubasaogawa/regex-replacing-tee"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/tsubasaogawa/regex-replacing-tee","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tsubasaogawa%2Fregex-replacing-tee","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tsubasaogawa%2Fregex-replacing-tee/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tsubasaogawa%2Fregex-replacing-tee/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tsubasaogawa%2Fregex-replacing-tee/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tsubasaogawa","download_url":"https://codeload.github.com/tsubasaogawa/regex-replacing-tee/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tsubasaogawa%2Fregex-replacing-tee/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":271885266,"owners_count":24838640,"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-08-24T02:00:11.135Z","response_time":111,"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":["golang","regex","tee","text-processing"],"created_at":"2024-12-06T04:14:58.145Z","updated_at":"2025-08-24T14:18:53.300Z","avatar_url":"https://github.com/tsubasaogawa.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# regex-replacing-tee (rrtee)\n\n## Overview\n\nThis is an extension of tee, a tool that performs replacements by regular expressions while writing text.\n\n## Motivation\n\nFor example, if you save text containing colour codes with tee, the escape sequence will be included in the file.\n\n```console\ntotal 44\ndrwxr-xr-x  2 root root   4096 Apr 24  2018 ESC[0mESC[01;34mbackupsESC[0m\ndrwxr-xr-x 10 root root   4096 Oct  2  2022 ESC[01;34mcacheESC[0m\ndrwxrwxrwt  2 root root   4096 Aug 22  2020 ESC[30;42mcrashESC[0m\n  :\n```\n\nTherefore, a separate operation to remove the escape sequence is required after the tee command, e.g. by using the sed command.\n\nrrtee can apply a substitution to files directly without such post-processing.\n\n## Usage\n\n```bash\ncommand | rrtee [-c config file path] \u003coutput file path\u003e\n```\n\n## Example\n\n```bash\nls -l --color=always /var | ./rrtee -c config.toml /tmp/aaa\n```\n\nConsole shows the following:\n\n![ls](doc/ls.png)\n\nOn the other hand, `/tmp/aaa` has no escape sequences:\n\n```console\ntotal 44\ndrwxr-xr-x  2 root root   4096 Apr 24  2018 backups\ndrwxr-xr-x 10 root root   4096 Oct  2  2022 cache\ndrwxrwxrwt  2 root root   4096 Aug 22  2020 crash\ndrwxr-xr-x 38 root root   4096 Nov 23  2022 lib\ndrwxrwsr-x  2 root staff  4096 Apr 24  2018 local\nlrwxrwxrwx  1 root root      9 Aug 22  2020 lock -\u003e /run/lock\ndrwxrwxr-x  8 root syslog 4096 Oct  2  2022 log\ndrwxrwsr-x  2 root mail   4096 Aug 22  2020 mail\ndrwxr-xr-x  2 root root   4096 Aug 22  2020 opt\nlrwxrwxrwx  1 root root      4 Aug 22  2020 run -\u003e /run\ndrwxr-xr-x  2 root root   4096 Jul 10  2020 snap\ndrwxr-xr-x  4 root root   4096 Aug 22  2020 spool\ndrwxrwxrwt  2 root root   4096 Jul  2 22:43 tmp\n```\n\n## Configuration\n\nYou can add/delete a rule using `rules.` prefix.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftsubasaogawa%2Fregex-replacing-tee","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftsubasaogawa%2Fregex-replacing-tee","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftsubasaogawa%2Fregex-replacing-tee/lists"}