{"id":13809175,"url":"https://github.com/codenameyau/intro-to-bash","last_synced_at":"2025-04-13T14:10:08.687Z","repository":{"id":68294623,"uuid":"200920429","full_name":"codenameyau/intro-to-bash","owner":"codenameyau","description":"Intro to bash with real-world examples and command-line tips","archived":false,"fork":false,"pushed_at":"2019-10-15T13:22:38.000Z","size":42,"stargazers_count":9,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-13T14:09:52.916Z","etag":null,"topics":["bash","ci","linux"],"latest_commit_sha":null,"homepage":null,"language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/codenameyau.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}},"created_at":"2019-08-06T20:32:08.000Z","updated_at":"2024-07-26T22:29:29.000Z","dependencies_parsed_at":"2023-02-22T02:45:10.456Z","dependency_job_id":null,"html_url":"https://github.com/codenameyau/intro-to-bash","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/codenameyau%2Fintro-to-bash","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codenameyau%2Fintro-to-bash/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codenameyau%2Fintro-to-bash/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codenameyau%2Fintro-to-bash/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/codenameyau","download_url":"https://codeload.github.com/codenameyau/intro-to-bash/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248724628,"owners_count":21151561,"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","ci","linux"],"created_at":"2024-08-04T01:02:04.424Z","updated_at":"2025-04-13T14:10:08.658Z","avatar_url":"https://github.com/codenameyau.png","language":null,"funding_links":[],"categories":["Others"],"sub_categories":[],"readme":"# intro-to-bash\n\nRecommended Resources\n- Official GNU reference: https://www.gnu.org/software/bash/manual/html_node/index.html\n- Bash Guide for Beginners: https://www.tldp.org/LDP/Bash-Beginners-Guide/html/\n\n## Hot Tips\n\n### How to use variables correctly\nSpacing is critical in bash since commands are separated by spaces.\nAssignments, for example, should be done without spaces.\n```sh\n# Bad. Interprets line as 3 separate commands.\nvar = 'lol'\n\n# Good. Will assign 'lol' to var.\nvar='lol'\n```\n\nAlways use `lower_case` for local variables and `UPPER_CASE` for environment variables.\n```sh\n# local variable.\nmy_local_variable='lol'\n\n# environment variable.\nexport MY_ENV_VARIABLE='lol'\n```\n\nAlways use **single quotes for string literals** and **double quotes for interpolated strings**.\n\n```sh\ncat='sunny'\nlol='hello $cat'\necho \"$lol\"\n\n# prints\n# hello $cat\n```\n\n```sh\ncat='sunny'\nlol=\"hello $cat\"\necho \"$lol\"\n\n# prints\n# hello sunny\n```\n\nAlways double quote variables unless you know what you're doing. The only exceptions\nare for loops and the test expression syntax with double brackets, e.g. `[[ $name = 'cat' ]]`.\n\n```sh\nwords=\"good boy does fine\"\n\n# Bad. Executes 4 separate commands with 1 word arg.\nls $words\n\n# Good. Executes a single command with 4 args.\nls \"$words\"\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodenameyau%2Fintro-to-bash","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcodenameyau%2Fintro-to-bash","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodenameyau%2Fintro-to-bash/lists"}