{"id":16719108,"url":"https://github.com/kgryte/shell-compute","last_synced_at":"2026-01-03T04:32:11.344Z","repository":{"id":21739105,"uuid":"25060890","full_name":"kgryte/shell-compute","owner":"kgryte","description":"Collection of shell scripts for computation.","archived":false,"fork":false,"pushed_at":"2014-10-11T23:13:41.000Z","size":156,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-01-22T01:45:00.040Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Awk","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/kgryte.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":"2014-10-11T02:49:54.000Z","updated_at":"2014-11-06T09:40:17.000Z","dependencies_parsed_at":"2022-08-17T19:50:45.116Z","dependency_job_id":null,"html_url":"https://github.com/kgryte/shell-compute","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kgryte%2Fshell-compute","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kgryte%2Fshell-compute/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kgryte%2Fshell-compute/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kgryte%2Fshell-compute/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kgryte","download_url":"https://codeload.github.com/kgryte/shell-compute/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243719400,"owners_count":20336607,"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","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-12T21:40:15.255Z","updated_at":"2026-01-03T04:32:11.309Z","avatar_url":"https://github.com/kgryte.png","language":"Awk","readme":"shell-compute\n===========\n\n\u003e Collection of shell scripts for computation.\n\n\n## Usage\n\nTo use a script, you can either stream a data file\n\n``` bash\n$ awk -f \u003cscript_name\u003e \u003cfile\u003e\n```\n\nor pipe output from a `command`\n\n``` bash\n$ command | awk -f \u003cscript_name\u003e\n```\n\n## Notes\n\nEach program works on a single column of data. For most programs, you specify the column over which to perform the computation by passing a `col` parameter. For example,\n\n``` bash\n$ echo $'1 2\\n1 2\\n1 2' | awk -v col=2 -f sum.awk\n# 6\n```\n\ninstructs `sum.awk` to sum over the second column.\n\n\n## Programs\n\n### Statistics\n\n#### count\n\nCompute the total number of values.\n\n``` bash\n$ echo $'1\\n2\\n4' | awk -f count.awk\n# 3\n```\n\n#### min\n\nCompute the minimum value.\n\n``` bash\n$ echo $'5\\n2\\n8' | awk -v col=1 -f min.awk\n# 2\n```\n\n#### max\n\nCompute the maximum value.\n\n``` bash\n$ echo $'5\\n2\\n8' | awk -v col=1 -f max.awk\n# 8\n```\n\n#### sum\n\nCompute the sum.\n\n``` bash\n$ echo $'1\\n2\\n3' | awk -v col=1 -f sum.awk\n# 6\n```\n\n#### mean\n\nCompute the arithmetic mean.\n\n``` bash\n$ echo $'5\\n2\\n8' | awk -v col=1 -f mean.awk\n# 5\n```\n\n\n#### median\n\nCompute the median.\n\n``` bash\n$ echo $'5\\n2\\n8\\n6' | sort -n | awk -v col=1 -f median.awk\n# 5.5\n```\n\nNote: the values over which to compute the median should be __sorted__.\n\n\n## Examples\n\nTo run the examples, navigate to the `/examples` directory\n\n``` bash\n$ cd examples\n```\n\nand run\n\n``` bash\n$ bash ./examples.sh\n```\n\n\n## License\n\n[MIT license](http://opensource.org/licenses/MIT). \n\n\n---\n## Copyright\n\nCopyright \u0026copy; 2014. Athan Reines.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkgryte%2Fshell-compute","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkgryte%2Fshell-compute","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkgryte%2Fshell-compute/lists"}