{"id":25743382,"url":"https://github.com/freight-trust/bash","last_synced_at":"2026-04-08T20:02:55.807Z","repository":{"id":103602942,"uuid":"277231928","full_name":"freight-trust/bash","owner":"freight-trust","description":"Shell Scripts Repository","archived":false,"fork":false,"pushed_at":"2020-08-01T19:48:38.000Z","size":155,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-11-19T20:25:54.751Z","etag":null,"topics":["bash","cli","iterm2","linux","mac","scripts","shell","terminal","zsh"],"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/freight-trust.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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2020-07-05T04:39:01.000Z","updated_at":"2020-08-01T19:48:40.000Z","dependencies_parsed_at":"2023-03-13T15:07:15.413Z","dependency_job_id":null,"html_url":"https://github.com/freight-trust/bash","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":"pforret/bash-boilerplate","purl":"pkg:github/freight-trust/bash","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/freight-trust%2Fbash","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/freight-trust%2Fbash/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/freight-trust%2Fbash/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/freight-trust%2Fbash/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/freight-trust","download_url":"https://codeload.github.com/freight-trust/bash/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/freight-trust%2Fbash/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31571601,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-08T14:31:17.711Z","status":"ssl_error","status_checked_at":"2026-04-08T14:31:17.202Z","response_time":54,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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","cli","iterm2","linux","mac","scripts","shell","terminal","zsh"],"created_at":"2025-02-26T10:19:38.001Z","updated_at":"2026-04-08T20:02:55.790Z","avatar_url":"https://github.com/freight-trust.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"![Bash CI](https://github.com/pforret/bash-boilerplate/workflows/Bash%20CI/badge.svg) \r\n![Shellcheck CI](https://github.com/pforret/bash-boilerplate/workflows/Shellcheck%20CI/badge.svg)\r\n![version](https://img.shields.io/github/v/release/pforret/bash-boilerplate?include_prereleases)\r\n![activity](https://img.shields.io/github/commit-activity/m/pforret/bash-boilerplate)\r\n![license](https://img.shields.io/github/license/pforret/bash-boilerplate)\r\n![repo size](https://img.shields.io/github/repo-size/pforret/bash-boilerplate)\r\n\r\n### BASH BOILERPLATE\r\n\r\nIt's like a mini console framework for bash shell scripting.\r\n\r\nJust use one of 4 methods to generate a new script, that has all the functionality to \r\n\r\n1.\tone self-contained file, no external dependencies\r\n2.\tparse options and parameters \r\n3.\tgenerate clean usage \r\n4.\trun in silent/quiet or verbose mode\r\n5.\tcreate and clean up temporary folder/files\r\n6.\tbetter error reporting\r\n7.\tBash CI (Github Actions)\r\n8.\tself-initialisation for new scripts (`script.sh init`)\r\n\r\n\t\tflag|h|help|show usage\r\n\t\tflag|q|quiet|no output\r\n\t\tflag|v|verbose|output more\r\n\t\tflag|f|force|do not ask for confirmation\r\n\t\toption|l|logd|folder for log files |log\r\n\t\toption|t|tmpd|folder for temp files|.tmp\r\n\t\tparam|1|action|action to perform: LIST/TEST/...\r\n\t\tparam|1|output|output file\r\n\t\t# there can only be 1 param|n and it should be the last\r\n\t\tparam|n|inputs|input files\r\n\r\nbecomes\r\n\r\n### USAGE\n      Program: script.sh by @email\n      Version: @version (L:591-MD:3f7bbf)\n      Updated: Jun 13 10:23:44 2020\n      Usage: script.sh [-h] [-q] [-v] [-f] [-l \u003clogd\u003e] [-t \u003ctmpd\u003e] \u003caction\u003e \u003coutput\u003e \u003cinputs …\u003e\n      Flags, options and parameters:\n          -h|--help      : [flag] show usage [default: off]\n          -q|--quiet     : [flag] no output [default: off]\n          -v|--verbose   : [flag] output more [default: off]\n          -f|--force     : [flag] do not ask for confirmation (always yes) [default: off]\n          -l|--logd \u003cval\u003e: [optn] folder for log files   [default: log]\n          -t|--tmpd \u003cval\u003e: [optn] folder for temp files  [default: .tmp]\n          \u003caction\u003e  : [parameter] action to perform: init/list/test/...\n          \u003coutput\u003e  : [parameter] output file\n          \u003cinputs\u003e  : [parameters] input files (1 or more)\n      \n### SCRIPT AUTHORING TIPS\n      * use out to show any kind of output, except when option --quiet is specified\n        out \"User is [$USER]\"\n      * use progress to show one line of progress that will be overwritten by the next output\n        progress \"Now generating file $nb of $total ...\"\n      * use is_empty and is_not_empty to test for variables\n        if ! confirm \"Delete file\"; then ; echo \"skip deletion\" ; fi\n      * use die to show error message and exit program\n        if [[ ! -f $output ]] ; then ; die \"could not create output\" ; fi\n      * use alert to show alert message but continue\n        if [[ ! -f $output ]] ; then ; alert \"could not create output\" ; fi\n      * use success to show success message but continue\n        if [[ -f $output ]] ; then ; success \"output was created!\" ; fi\n      * use announce to show the start of a task\n        announce \"now generating the reports\"\n      * use log to show information that will only be visible when -v is specified\n        log \"input file: [$inputname] - [$inputsize] MB\"\n      * use escape to extra escape '/' paths in regex\n        sed 's/$(escape $path)//g'\n      * use lcase and ucase to convert to upper/lower case\n        param=$(lcase $param)\n      * use confirm for interactive confirmation before doing something\n        if ! confirm \"Delete file\"; then ; echo \"skip deletion\" ; fi\n      * use ask for interactive setting of variables\n        ask NAME \"What is your name\" \"Peter\"\n      * use on_mac/on_linux/'on_32bit'/'on_64bit' to only run things on certain platforms\n        on_mac \u0026\u0026 log \"Running on MacOS\"\n      * use folder_prep to create a folder if needed and otherwise clean up old files\n        folder_prep \"$logd\" 7 # delete all files olders than 7 days\n\r\n### VERSION HISTORY\r\n\r\n* v1.7: all editable content to the front of the file\r\n* v1.6: introduce semver versioning, Bash CI\r\n* v1.5: fixed last shellcheck warnings - https://github.com/koalaman/shellcheck\r\n* v1.4: fix md5sum problem, add script authoring tips, automated README creation\r\n* v1.3: robuster parameter parsing\r\n* v1.2: better error trap and versioning info\r\n* v1.1: better single and multi param parsing\r\n* v1.0: first release\r\n\r\n \r\n### CREATE NEW BASH SCRIPT\n\n#### Option 1: clone this repo\n\t\n\tgit clone https://github.com/pforret/bash-boilerplate.git\n\tcp bash-boilerplate/script.sh my-new-script.sh\n\n#### Option 2: create new Github repo from template\n\t\ngo to https://github.com/pforret/bash-boilerplate - press \"Use this template\"\n\n#### Option 3: download the script directly\n\n\twget https://raw.githubusercontent.com/pforret/bash-boilerplate/master/script.sh\n\tmv script.sh my-new-script.sh\n\n#### Option 4: customize parameters and copy/paste\n\t\ngo to [toolstud.io/data/bash.php](https://toolstud.io/data/bash.php)\n\n### EXAMPLES\r\n\r\nThese scripts were made with some version of [bash-boilerplate](https://github.com/pforret/bash-boilerplate)\r\n\r\n* [github.com/pforret/crontask](https://github.com/pforret/crontask)\r\n* [github.com/pforret/networkcheck](https://github.com/pforret/networkcheck)\r\n* [github.com/cinemapub/signage_prep](https://github.com/cinemapub/signage_prep)\r\n* send me your example repos!\r\n\r\n### ACKNOWLEDGEMENTS\r\n\r\nI learned a lot of tips from these sources:\r\n\r\n* Daniel Mills, [e36freak](https://github.com/e36freak)\r\n* Kfir Lavi [www.kfirlavi.com](http://www.kfirlavi.com/blog/2012/11/14/defensive-bash-programming)\r\n* Aaron Maxwell [redsymbol.net](http://redsymbol.net/articles/unofficial-bash-strict-mode/)\r\n* Bash Variables [gnu.org](https://www.gnu.org/software/bash/manual/html_node/Bash-Variables.html)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffreight-trust%2Fbash","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffreight-trust%2Fbash","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffreight-trust%2Fbash/lists"}