{"id":17383012,"url":"https://github.com/caquino/redis-bash","last_synced_at":"2025-05-08T21:03:31.067Z","repository":{"id":1746673,"uuid":"2572673","full_name":"caquino/redis-bash","owner":"caquino","description":"REDIS-BASH - Bash library to access Redis","archived":false,"fork":false,"pushed_at":"2023-01-01T22:22:13.000Z","size":82,"stargazers_count":163,"open_issues_count":1,"forks_count":39,"subscribers_count":11,"default_branch":"master","last_synced_at":"2025-03-31T18:14:20.093Z","etag":null,"topics":["bash","bash-script","redis","shell-script"],"latest_commit_sha":null,"homepage":"https://github.com/caquino/redis-bash","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/caquino.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"COPYING","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2011-10-13T21:44:08.000Z","updated_at":"2025-01-22T22:33:43.000Z","dependencies_parsed_at":"2023-01-11T16:05:42.216Z","dependency_job_id":null,"html_url":"https://github.com/caquino/redis-bash","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/caquino%2Fredis-bash","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/caquino%2Fredis-bash/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/caquino%2Fredis-bash/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/caquino%2Fredis-bash/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/caquino","download_url":"https://codeload.github.com/caquino/redis-bash/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253149575,"owners_count":21861734,"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":["bash","bash-script","redis","shell-script"],"created_at":"2024-10-16T07:40:16.444Z","updated_at":"2025-05-08T21:03:30.905Z","avatar_url":"https://github.com/caquino.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# REDIS-BASH - Bash library to access Redis Databases\n\n[![Release](https://github.com/caquino/redis-bash/actions/workflows/release.yml/badge.svg)](https://github.com/caquino/redis-bash/actions/workflows/release.yml)\n* The library comes with two examples, one generic client and a pubsub demo.\n* This library has no external dependencies, using only bash built-in commands.\n* The only requirement is bash to have net redirections enabled.\n* The command validation is made by the server.\n\n## Using the client and the pubsub demo\n\n### Client\n```bash\n$ redis-bash-cli \u003cPARAMETERS\u003e \u003cCOMMAND\u003e \u003cARGUMENTS\u003e\n```\n\nParameters:\n\n```\n-h Host - Defaults localhost.\n-p Port - Defaults 6379.\n-n DB - Select the database DB.\n-r N - Repeat command N times.\n-a PASSWORD - Authentication password\n-i INTERVAL - Interval between commands\n```\n\nExamples:\n\n```bash\n$ redis-bash-cli -h localhost SET testkey 1234\nOK\n\n$ redis-bash-cli -h localhost GET testkey\n1234\n\n$ redis-bash-cli -h localhost PING\nPONG\n\n$ redis-bash-cli -h localhost -r 5 PING\nPONG\nPONG\nPONG\nPONG\nPONG\n\n$ redis-bash-cli -h localhost WRONGCOMMAND test\nERR unknown command 'WRONGCOMMAND'\n```\n\nAuthenticated requests:\n\n```bash\n$ redis-bash-cli -h localhost PING\nERR operation not permitted\n\n$ redis-bash-cli -h localhost -a test PING\nPONG\n```\n\n### Pubsub\n\n```bash\n$ redis-pubsub-test \u003cPARAMETERS\u003e \u003cCHANNEL\u003e\n```\n\nParameters:\n\n```bash\n-h Host - Defaults localhost.\n-p Port - Defaults 6379.\nCHANNEL - Channel to subscribe\n```\n\n## Pubsub demo\nIn one shell run the command:\n\n```bash\n$ redis-pubsub-test test\n```\n\nIn another shell run the command:\n\n```bash\n$ redis-bash-cli -h localhost -p 6379 PUBLISH test \"Hello World.\"\n```\n\n# Using the Library in your code\nThe library have a single function to handle the redis communication.\n\n```bash\n$ redis-client \u003cFD\u003e \u003cCOMMAND\u003e\n```\n\n* FD: file descriptor to access the redis database\n* COMMAND: command to be sent to the server, can be blank to do read operation.\n\nUsing the library:\n\n```bash\n#!/bin/bash\nsource redis-bash-lib # include the library\nexec 6\u003c\u003e/dev/tcp/localhost/6379 # open the connection\nredis-client 6 SET test 1234 # do a SET operation\nexec 6\u003e\u0026- # close the connection\n```\n\n# TODO\n* manual page\n* tests\n* documentation\n\n# LICENSE\n* BSD\n\n# Debian Package\n* To build the debian/ubuntu package use dpkg-buildpackage.\n\n# CONTACT\n* email: cassianoaquino at me.com\n* twitter: @syshero\n* blog: http://syshero.org/\n\n# THANKS\n* Andre Ferraz - Debian Package\n* Juliano Martinez - Idea to handle socket disconnections on the pubsub demo\n\n# TESTED\n* Debian squeeze 6.0.X - GNU bash, version 4.1.5(1)-release (x86_64-pc-linux-gnu)\n* Mac OS X Lion 10.7.X - GNU bash, version 3.2.48(1)-release (x86_64-apple-darwin11)\n\n# PERFORMANCE\n\nThis test has no intent to be a complete benchmark, but only to show the diference between both clients.\n\n\n```bash\n$ time redis-bash-cli -h 192.168.86.1 -r 10 PING \u003e /dev/null\n\nreal0m0.027s\nuser0m0.000s\nsys0m0.024s\n\n$ time redis-cli -h 192.168.86.1 -r 10 PING \u003e /dev/null\n\nreal0m0.012s\nuser0m0.000s\nsys0m0.008s\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcaquino%2Fredis-bash","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcaquino%2Fredis-bash","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcaquino%2Fredis-bash/lists"}