{"id":15747289,"url":"https://github.com/rwaskiewicz/rawk","last_synced_at":"2026-02-21T04:31:27.571Z","repository":{"id":38146945,"uuid":"316290857","full_name":"rwaskiewicz/rawk","owner":"rwaskiewicz","description":"a toy awk implementation","archived":false,"fork":false,"pushed_at":"2025-03-31T01:21:07.000Z","size":442,"stargazers_count":1,"open_issues_count":3,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-21T14:13:11.296Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Rust","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/rwaskiewicz.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,"zenodo":null}},"created_at":"2020-11-26T16:59:18.000Z","updated_at":"2025-01-02T23:56:42.000Z","dependencies_parsed_at":"2024-10-25T04:14:29.304Z","dependency_job_id":"1ff1710c-432e-45f1-a4ee-6f198b224206","html_url":"https://github.com/rwaskiewicz/rawk","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/rwaskiewicz/rawk","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rwaskiewicz%2Frawk","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rwaskiewicz%2Frawk/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rwaskiewicz%2Frawk/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rwaskiewicz%2Frawk/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rwaskiewicz","download_url":"https://codeload.github.com/rwaskiewicz/rawk/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rwaskiewicz%2Frawk/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29673785,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-21T03:11:15.450Z","status":"ssl_error","status_checked_at":"2026-02-21T03:10:34.920Z","response_time":107,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":[],"created_at":"2024-10-04T05:04:37.534Z","updated_at":"2026-02-21T04:31:27.546Z","avatar_url":"https://github.com/rwaskiewicz.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# r-awk\n\na toy [awk](https://en.wikipedia.org/wiki/AWK) written in [Rust](https://www.rust-lang.org/), feature incomplete.\n\n## Minimum Rust Version\n\nThe minimum version required to compile and run r-awk can be found under the `rust-version` key in the project's [`Cargo.toml`](./Cargo.toml) file.\n\n## Compiling\n\n```commandline\ncargo build --release\n```\n\n## Running\n\nAt this time, running a REPL is fully supported and has limited support for awk file reading. \nLike a real awk, this r-awk will take a single program from the STDIN when invoked.\nIt then will prompt for input to serve as the data that is fed into the program.\n\nThe program below demonstrates running a [compiled](#compiling) r-awk and demonstrates the usage of \n[field variables](https://www.gnu.org/software/gawk/manual/gawk.html#Fields) and\n[field separators](https://www.gnu.org/software/gawk/manual/html_node/Single-Character-Fields.html).\n\n```commandline\n./rawk -F, '{print $2 * $3 + $1;}'\n1,2,3\n7\n4,5,6\n34\n```\n\nPatterns are supported:\n```commandline\n./rawk -F, '$1 \u003e $2 {print \"First is bigger\";} $2 \u003e $1 {print \"Second is bigger\";}'\n1,2\nSecond is bigger\n2,1\nFirst is bigger\n```\n\nMulti-line programs are supported in the REPL.\nTake 'fizzbuzz' for example:\n```\n./rawk '{\n    for (i=0; i\u003c=100; i=i+1) {\n      result = \"\";\n      if (i % 3 == 0) { \n        result = \"fizz\";\n      }\n      if (i % 5 == 0) {\n        result = result \"buzz\";\n      }\n      if (result == \"\") {\n        result = i;\n      }\n      print result;\n    }\n}'\n```\n\nReading an awk program from a file:\n```commandline\n./rawk -f ./awk_examples/field_variables/it_prints_all_line_parts.awk\nIN: alice 40 25\nOUT: alice 40 25\n```\n\nReading an awk program and data from a file:\n```commandline\n./rawk -f ./awk_examples/field_variables/it_prints_all_line_parts.awk ./tests/data/hours1.dat\nAlice 25.00 10\nBob 20.75 20\nCharlie 15.25 40\nDan 21.50 0\nErin 22.00 30\n```\n\n## Logging\nThe `env_logger` crate is used as the implementation behind the `log` facade.\nInstructions for configuring log levels can be found in the crate's [documentation](https://docs.rs/env_logger/0.8.2/env_logger/).\n\nBy default, the REPL will run with the ['Info' log filter](https://docs.rs/env_logger/0.8.2/env_logger/struct.Builder.html).\n\nExample usage:\n```commandline\nRUST_LOG=debug cargo run -- '{print $2 * $3 + $1;}'\n```\n\n## References\n- [IEEE Std 1003.1-2017](https://pubs.opengroup.org/onlinepubs/9699919799/utilities/awk.html) - the POSIX specification for the awk language\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frwaskiewicz%2Frawk","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frwaskiewicz%2Frawk","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frwaskiewicz%2Frawk/lists"}