{"id":18488769,"url":"https://github.com/samk13/bash-notes","last_synced_at":"2025-08-14T07:35:55.652Z","repository":{"id":103468024,"uuid":"452839123","full_name":"Samk13/bash-notes","owner":"Samk13","description":null,"archived":false,"fork":false,"pushed_at":"2024-11-16T16:01:42.000Z","size":15,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-02-16T22:26:23.538Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Shell","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/Samk13.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-01-27T20:47:41.000Z","updated_at":"2024-11-16T16:01:46.000Z","dependencies_parsed_at":"2024-11-06T12:55:27.881Z","dependency_job_id":"0cd52b1d-ff98-4507-89f3-f3b326ab4208","html_url":"https://github.com/Samk13/bash-notes","commit_stats":null,"previous_names":["samk13/bash-notes"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Samk13%2Fbash-notes","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Samk13%2Fbash-notes/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Samk13%2Fbash-notes/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Samk13%2Fbash-notes/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Samk13","download_url":"https://codeload.github.com/Samk13/bash-notes/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254036812,"owners_count":22003655,"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-06T12:52:47.774Z","updated_at":"2025-05-13T22:32:35.254Z","avatar_url":"https://github.com/Samk13.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n## Evaluate expression\n[label](./evaluate.sh)\n```bash\nexpr # Evaluate an expression\n```\n\n## If statements\n```bash\nif [ $num -eq 200 ]  # -eq equal\nif [ ! $num -eq 200 ]  # ! not equal\nif [ ! $num -ne 200 ]  # -ne not equal\nif [ ! $num -gt 200 ]  # -gt greater then\nif [ -f README.md ] # -f check file exists\nif [ -d /src ] # -d check directory exists\nif command -v $command # check command exists\n\n```\n\n\u003e test - check file types and compare values\n\n# Exit codes\n```bash\n# Special vaieables for exit codes\necho $? # if exit code is 0 the command is successfull, otherwise there is somthing went wrong. so you can test on exit code value if it's not 0 do something\n[label](./exit_codes.sh)\n```\n\n# While loop:\n\n```bash\nwhile [ -f $file ]\ndo\n    echo \"file exists $(date)\"\n    sleep 5\ndone\n```\n\n# Data stream:\nnumber 1 -\u003e standard output\nnumber 2 -\u003e standard error\ndiffrence between 1\u003e /path, and 1\u003e\u003e /path is the second one with double \u003e\u003e is append to the file localtion the first one will override everything\n\n```bash\nfind /etc -type f 2\u003e /dev/null  # redirect err to linux special place dev/null where if you move something there it will be completely wiped out like a block hole\nfind /etc -type f \u0026\u003e /dev/null # redirect both standard output and standard error to the specified location\n```\n\n# Commands:\n\nFor testing upload files with specific size you can use:\n\n```bash\nfallocate -l 9.99G test10Gfile\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsamk13%2Fbash-notes","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsamk13%2Fbash-notes","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsamk13%2Fbash-notes/lists"}