{"id":23119593,"url":"https://github.com/mig8447/bash_scripts","last_synced_at":"2026-04-17T01:02:42.219Z","repository":{"id":132381488,"uuid":"143966285","full_name":"mig8447/bash_scripts","owner":"mig8447","description":"A repository for Bash scripts I've written over time","archived":false,"fork":false,"pushed_at":"2022-10-14T04:53:24.000Z","size":40,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-04T02:41:53.226Z","etag":null,"topics":["bash","bashrc","home","libraries","scripts"],"latest_commit_sha":null,"homepage":"","language":"Shell","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/mig8447.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-08-08T05:43:18.000Z","updated_at":"2023-07-25T14:19:01.000Z","dependencies_parsed_at":"2023-07-04T10:46:57.218Z","dependency_job_id":null,"html_url":"https://github.com/mig8447/bash_scripts","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/mig8447/bash_scripts","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mig8447%2Fbash_scripts","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mig8447%2Fbash_scripts/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mig8447%2Fbash_scripts/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mig8447%2Fbash_scripts/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mig8447","download_url":"https://codeload.github.com/mig8447/bash_scripts/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mig8447%2Fbash_scripts/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":264505037,"owners_count":23618882,"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","bashrc","home","libraries","scripts"],"created_at":"2024-12-17T05:39:36.122Z","updated_at":"2026-04-17T01:02:33.096Z","avatar_url":"https://github.com/mig8447.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# mig8447's Bash Scripts\nA repository for Bash scripts I've written over time.\n\n## Functions\n\n### `record_terminal` (alias `recterm`)\n![](https://img.shields.io/badge/date%20added-04--MAR--19-lightgrey.svg)\n\nThis function is a wrapper of the `script` program included in several *UNIX-like* operating systems/distributions. It records the terminal session capturing timing information to be played later via [`play_terminal_recording`](#play_terminal_recording-alias-playterm).\n\n**NOTE**: Once the recording is started, you can exit by typing the `exit` command\n\n#### Prerequisites\n\nYou need to have the `script` program installed in your environment and accessible in the `$PATH`. In Linux, this program normally comes in a package called `util-linux` or the newer `util-linux-ng`\n\n#### Example\n\n```\n$ record_terminal\nINFO: record_terminal: Now Recording \"recording_20190304_184317\"...\nScript started, file is /.../recording_20190304_184317.ts\n$ whoami\nmig8447\n$ exit\nexit\nScript done, file is /.../recording_20190304_184317.ts\nINFO: record_terminal: \"recording_20190304_184317\" recording has finished\n```\n\n#### Output\n\nThis function produces two files:\n\n- `\u003cRECORDING_NAME\u003e.timing.ts`: A file containing the timing information for playback purposes\n- `\u003cRECORDING_NAME\u003e.ts`: The actual typescript which will contain the text of the recorded terminal session including all escaping sequences for commands and special keys, which in turn makes this not *human-friendly*\n\nSuch files are written to a directory designated by the `$TERMINAL_TYPESCRIPTS_DIR` which by default gets created under `\"$HOME\"'/terminal_typescripts'` by the `install.sh` script\n\n#### Parameters\n\nParameters for this function are positional:\n\n1. **The recording name**: If provided this will be the prefix for the file names to which the recording will be saved to. If this parameter is omitted or a zero-length string, then the recording name gets populated with the `recording_` prefix and the current date in `%Y%m%d_%H%M%S` format.\n\n#### Exit Codes\n\nThis wrapper, for most cases, will return the exit codes provided by the `script` tool. The only case on which it will return the custom exit code 1 is whenever the file pair that the user is trying to write to already exists, this preventing the user from overwriting or appending output to a file when using this wrapper because that's usually not the desired behavior.\n\n### `play_terminal_recording` (alias `playterm`)\n![](https://img.shields.io/badge/date%20added-04--MAR--19-lightgrey.svg)\n\nThis function is a wrapper of the `scriptreplay` program included in several *UNIX-like* operating systems/distributions. It plays-back a terminal session recorded using [`record_terminal`](#record_terminal-alias-recterm) function.\n\n**NOTE:** Once started, you can stop the terminal recording playback hitting `Ctrl + C`\n\n#### Prerequisites\n\nYou need to have the `scriptreplay` program installed in your environment and accessible in the `$PATH`. In Linux, this program normally comes in a package called `util-linux` or the newer `util-linux-ng`\n\n#### Example\n\n```\n$ play_terminal_recording recording_20190304_184317\nINFO: play_terminal_recording: Now Playing \"recording_20190304_184317\"...\n$ whoami\nmig8447\n$ exit\n\nINFO: play_terminal_recording: \"recording_20190304_184317\" ended\n```\n\n#### Input\n\nThis function requires two input files:\n\n- `\u003cRECORDING_NAME\u003e.timing.ts`: A file containing the timing information for playback purposes\n- `\u003cRECORDING_NAME\u003e.ts`: The actual typescript which contains the text of the recorded terminal session\n\nSuch files must be located within a directory designated by the `$TERMINAL_TYPESCRIPTS_DIR` which by default gets created under `\"$HOME\"'/terminal_typescripts'` by the `install.sh` script\n\n#### Parameters\n\nParameters for this function are positional:\n\n1. **The recording name**: The name passed in the first parameter of the `record_terminal` function.\n2. **The playback speed**: The speed at which the recording will be played (e.g. 1 for 1x playback, 0.5 for 0.5x playback, 20 for 20x playback, etc.)\n\n#### Exit Codes\n\nThis wrapper, for most cases, will return the exit codes provided by the `scriptreplay` tool. The only cases on which it will return the custom exit code 1 is whenever the file pair that the user is trying to play doesn't exist, is not a file or is not readable by the current user, or whenever the user doesn't pass any recording name as the first parameter.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmig8447%2Fbash_scripts","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmig8447%2Fbash_scripts","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmig8447%2Fbash_scripts/lists"}