{"id":18925589,"url":"https://github.com/nightmachinery/possiblycat","last_synced_at":"2026-03-14T15:30:18.016Z","repository":{"id":115498894,"uuid":"297115141","full_name":"NightMachinery/possiblycat","owner":"NightMachinery","description":"cat with a timeout on waiting for the first byte of stdin","archived":false,"fork":false,"pushed_at":"2020-09-21T11:03:23.000Z","size":3,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-12-31T17:48:08.230Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Go","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/NightMachinery.png","metadata":{"files":{"readme":"readme.org","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":"2020-09-20T16:18:24.000Z","updated_at":"2021-12-15T13:22:57.000Z","dependencies_parsed_at":null,"dependency_job_id":"85b085f8-658d-4655-84ae-da7e74a2a033","html_url":"https://github.com/NightMachinery/possiblycat","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/NightMachinery%2Fpossiblycat","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NightMachinery%2Fpossiblycat/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NightMachinery%2Fpossiblycat/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NightMachinery%2Fpossiblycat/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/NightMachinery","download_url":"https://codeload.github.com/NightMachinery/possiblycat/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239921844,"owners_count":19718844,"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-11-08T11:12:26.170Z","updated_at":"2026-03-14T15:30:17.981Z","avatar_url":"https://github.com/NightMachinery.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"#+TITLE: possiblycat\n\nA helper tool to optionally get the stdin if present.\n\n* Installation\n#+BEGIN_example\ngo get -u -v github.com/NightMachinary/possiblycat\n#+END_example\n* Usage\n#+begin_src bsh.dash :results verbatim :exports both\npossiblycat ; echo exited $?\n#+end_src\n\n#+RESULTS:\n: exited 0\n\n#+begin_src bsh.dash :results verbatim :exports both\ntime possiblycat\n#+end_src\n\n#+RESULTS:\n: possiblycat  0.00s user 0.00s system 66% cpu 0.005 total; max RSS 1852\n\n#+begin_src bsh.dash :results verbatim :exports both\n{ xxd -l 100 -p /dev/urandom ; ec --- ; ec ok } | possiblycat ; echo exited $?\n#+end_src\n\n#+RESULTS:\n: af61692667c76c5cc5235b632b43385988f473f6e4eab330a3bdf56af0c5\n: 9e3d48f49cde4be7cabb7694fea8417440b59f07142e9a7a4b32680955fe\n: 5c054a2ad97ec9833083647f99e8f14f223881e9d1d374c5a3f17b3d4b9e\n: 0c11a163029f2ef87601\n: ---\n: ok\n: exited 0\n\nYou can also give it the timeout duration in milliseconds:\n\n#+begin_src bsh.dash :results verbatim :exports both\ntrue | time possiblycat 500 ; echo exited $?\n#+end_src\n\n#+RESULTS:\n: exited 0\n: possiblycat 500  0.00s user 0.00s system 69% cpu 0.004 total; max RSS 1856\n\n#+begin_src bsh.dash :results verbatim :exports both\n{ sleep 1 ; echo hi } | time possiblycat 500 ; echo exited $?\n#+end_src\n\n#+RESULTS:\n: exited 1\n: possiblycat 500  0.00s user 0.00s system 0% cpu 0.508 total; max RSS 1868\n\n#+begin_src bsh.dash :results verbatim :exports both\n{ sleep 1 ; echo hi } | time possiblycat 1500 ; echo exited $?\n#+end_src\n\n#+RESULTS:\n: hi\n: exited 0\n: possiblycat 1500  0.00s user 0.00s system 0% cpu 1.005 total; max RSS 1872\n\n#+begin_src bsh.dash :results verbatim :exports both\n{ echo -n a ; sleep 0.3 ; echo $'\\n'ok } | possiblycat\n#+end_src\n\n#+RESULTS:\n: a\n: ok\n\n#+begin_src bsh.dash :results verbatim :exports both\n{ sleep 0.3 ; echo $'\\n'ok } | possiblycat\n#+end_src\n\n#+RESULTS:\n\n#+begin_src bsh.dash :results verbatim :exports none\n# Buggy here:\nstty cbreak ; bash -c 'echo -n a ; sleep 0.5 ; echo b' | possiblycat\n#+end_src\n\n#+RESULTS:\n: ab\n: stty: stdin isn't a terminal\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnightmachinery%2Fpossiblycat","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnightmachinery%2Fpossiblycat","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnightmachinery%2Fpossiblycat/lists"}