{"id":15373067,"url":"https://github.com/vi/fdlinecombine","last_synced_at":"2025-04-15T11:33:21.024Z","repository":{"id":1976306,"uuid":"2907863","full_name":"vi/fdlinecombine","owner":"vi","description":"Read multiple fds and print data to stdout linewise.","archived":false,"fork":false,"pushed_at":"2019-08-03T12:47:12.000Z","size":17,"stargazers_count":47,"open_issues_count":0,"forks_count":8,"subscribers_count":9,"default_branch":"master","last_synced_at":"2024-11-01T10:42:17.309Z","etag":null,"topics":["console","fd","tail","textutils"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"mortardata/mortar-recsys","license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/vi.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}},"created_at":"2011-12-04T00:15:45.000Z","updated_at":"2024-09-04T13:38:34.000Z","dependencies_parsed_at":"2022-08-20T12:11:17.266Z","dependency_job_id":null,"html_url":"https://github.com/vi/fdlinecombine","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vi%2Ffdlinecombine","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vi%2Ffdlinecombine/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vi%2Ffdlinecombine/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vi%2Ffdlinecombine/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/vi","download_url":"https://codeload.github.com/vi/fdlinecombine/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223673050,"owners_count":17183618,"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":["console","fd","tail","textutils"],"created_at":"2024-10-01T13:54:12.501Z","updated_at":"2024-11-08T11:03:27.485Z","avatar_url":"https://github.com/vi.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"Multiplex multiple input streams into stdout using \\n as separators.\n\nIt is attempt to make a program that Does One Thing, But Does It Well.\n\nFor example,\n\n    ./fdlinecombine \u003c( sleep 0; echo qqq ) \u003c( sleep 0; echo www) \u003c( sleep 0; echo eee)\n\nshould produce one of:\n\n* qqq\\nwww\\neee\\n\n* qqq\\neee\\nwww\\n\n* eee\\nqqq\\nwww\\n\n* eee\\nwww\\nqqq\\n\n* www\\neee\\nqqq\\n\n* www\\nqqq\\nqqq\\n\n\n, but never \"qqwww\\nqee\\ne\\n\" or like that.\n\nThe program should handle very long lines (storing them in memory), short reads, memory outage. In case of memory outage it closes the problematic file descriptor.\n\nThe program dynamically shrinks and enlarges buffers as line gets longer (or many bytes available at once)\n\nIn case of only short lines the program should use little memory:\n\n    yes | ( ulimit -v 500; ./fdlinecombine_static 0)  \u003e /dev/null\n\nExample of listening two sockets and combining the data to file:\n\n    ./fdlinecombine \u003c( nc -lp 9988 \u003c /dev/null) \u003c( nc -lp 9989 \u003c /dev/null) \u003e out\n\nYou can override line separator (it can be longer than one character) with SEPARATOR environment variable set to additional file descriptor (or file name).\nTrailing lines that does not end in separator are also outputted (followed by separator) unless NO_CHOPPED_DATA is set.\n\nMore advanced example:\n\n    SEPARATOR=\u003c(printf %s '\\n---\\n')  ./fdlinecombine 0 5 6  \\\n           5\u003c \u003c(nc -lp 9979 \u003c /dev/null)   \\\n           6\u003c \u003c(perl -e '$|=1; print \"TIMER\\n---\\n\" and sleep 2 while true' \u003c /dev/null) \\\n           \u003e out \n\nThis will transfer data from stdin, opened TCP port and periodic timer to file \"out\" using \"---\" line as separator.\n\n\nPre-built executables are on \"Download\" GitHub page or here:\n\n* http://vi-server.org/pub/fdlinecombine_static  - musl-based\n* http://vi-server.org/pub/fdlinecombine\n* http://vi-server.org/pub/fdlinecombine_arm \n* http://vi-server.org/pub/fdlinecombine_arm_static \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvi%2Ffdlinecombine","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvi%2Ffdlinecombine","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvi%2Ffdlinecombine/lists"}