{"id":20727674,"url":"https://github.com/cwchentw/mktext","last_synced_at":"2025-10-26T04:41:54.161Z","repository":{"id":77777892,"uuid":"132982753","full_name":"cwchentw/mktext","owner":"cwchentw","description":"An Useless Text-Processing Utility that Exploits Make Functions","archived":false,"fork":false,"pushed_at":"2018-05-11T22:12:13.000Z","size":12,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-11T09:28:14.394Z","etag":null,"topics":["gnu-make","make","makefile","text-processing"],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cwchentw.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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-05-11T03:10:24.000Z","updated_at":"2020-09-18T13:12:05.000Z","dependencies_parsed_at":"2023-08-24T03:30:21.853Z","dependency_job_id":null,"html_url":"https://github.com/cwchentw/mktext","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/cwchentw/mktext","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cwchentw%2Fmktext","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cwchentw%2Fmktext/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cwchentw%2Fmktext/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cwchentw%2Fmktext/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cwchentw","download_url":"https://codeload.github.com/cwchentw/mktext/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cwchentw%2Fmktext/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":281059639,"owners_count":26437057,"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-10-26T02:00:06.575Z","response_time":61,"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":["gnu-make","make","makefile","text-processing"],"created_at":"2024-11-17T04:33:21.215Z","updated_at":"2025-10-26T04:41:54.097Z","avatar_url":"https://github.com/cwchentw.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# mktext - An Useless Text-Processing Utility that Exploits Make Functions.\n\n**DON'T USE IT IN PRODUCTION CODE.**\n\nWe developed `mktext` just to demo how to use Make functions.\n\n## System Requirement\n\n* A recent `sh` compatible shell.\n* A recent GNU Make \u003e= 3.81\n\nWe tested `mktext` on a recent CentOS. It should work on most modern Unix-like systems.\n\n## Usage\n\n`mktext` provides several actions in functional styles:\n\n* `any`\n* `all`\n* `filter`\n* `select`\n* `sub`\n* `sort`\n* `first`\n* `last`\n* `nth`\n* `range`\n\n`any` checks whether any element fits *cond*:\n\n```\n$ ./mktext any x x y z\ntrue\n```\n\n`all` checks whether all elements fit *cond*:\n\n```\n$ ./mktext all x x y z\nfalse\n```\n\n`filter` removes elements by *cond*:\n\n```\n$ ./mktext filter \"a b c\" a b c d e f g\nd\ne\nf\ng\n```\n\n`select` keeps elements by *cond*:\n\n```\n$ ./mktext select \"a b c\" a b c d e f g\na\nb\nc\n```\n\n`sub` replaces *from* with *to*:\n\n```\n$ ./mktext sub ee ea beer deer feet\nbear\ndear\nfeat\n```\n\n`sort` sorts elements alphabetically:\n\n```\n$ ./mktext sort b d a e c\na\nb\nc\nd\ne\n```\n\n`first` returns the first element:\n\n```\n$ ./mktext first a b c d e\na\n```\n\n`last` returns the last element:\n\n```\n$ ./mktext last a b c d e\ne\n```\n\n`nth` returns the *n*th element:\n\n```\n$ ./mktext nth 4 a b c d e\nd\n```\n\n`range` returns the elements from *m*th to *n*th, inclusively on both side:\n\n```\n$ ./mktext range 2 4 a b c d e\nb\nc\nd\n```\n\nBesides, use `-h` and `--help` to print help message:\n\n```\n$ ./mktext --help\nUsage: ./mktext action ...\n\nActions:\n        all cond arg_a arg_b arg_c ...\n(Omit some message...)\n```\n\n## Philosophy\n\nMake functions are a small sets of LISPy functions that are greek to many programmers from C family languages. Hence, we wrote `mktext` to show how to (improperly) use those functions.\n\n`make` itself is unable to handle command-line arguments and several other features seen in `mktext`. To handle those issues, we embedded a Makefile in a shell script so that we can manage those issues with a `sh` compatible shell. We limit ourself in the features provided by `make` when possble; otherwise, we use the features available in the system shell.\n\nTo make a more useful alternative, consider to port it in Perl or some other modern scripting language.\n\n## Author\n\nMichael Chen, 2018.\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcwchentw%2Fmktext","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcwchentw%2Fmktext","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcwchentw%2Fmktext/lists"}