{"action":"created","comment":{"url":"https://api.github.com/repos/adambard/learnxinyminutes-docs/pulls/comments/30952674","id":30952674,"diff_hunk":"@@ -0,0 +1,284 @@\n+---\n+category: tool\n+tool: bash\n+contributors:\n+    - [\"Max Yankov\", \"https://github.com/golergka\"]\n+    - [\"Darren Lin\", \"https://github.com/CogBear\"]\n+    - [\"Alexandre Medeiros\", \"http://alemedeiros.sdf.org\"]\n+    - [\"Denis Arh\", \"https://github.com/darh\"]\n+    - [\"akirahirose\", \"https://twitter.com/akirahirose\"]\n+    - [\"Anton Strömkvist\", \"http://lutic.org/\"]\n+    - [\"Rahil Momin\", \"https://github.com/iamrahil\"]\n+    - [\"Gregrory Kielian\", \"https://github.com/gskielian\"]\n+    - [\"Etan Reisner\", \"https://github.com/deryni\"]\n+translators:\n+    - [\"Andrey Samsonov\", \"https://github.com/kryzhovnik\"]\n+filename: LearnBash-ru.sh\n+lang: ru-ru\n+---\n+\n+Bash - это командная оболочка unix (unix shell), которая распространялась как оболочка для операционной системы GNU и используется в качестве оболочки по умолчанию для Linux и Mac OS X.\n+Почти все нижеприведенные примеры могут быть частью shell-скриптов или исполнены напрямую в shell.\n+\n+[Подробнее.](http://www.gnu.org/software/bash/manual/bashref.html)\n+\n+```bash\n+#!/bin/bash\n+# Первая строка скрипта - это shebang, который сообщает системе, как исполнять\n+# этот скрипт: http://en.wikipedia.org/wiki/Shebang_(Unix)\n+# Как вы уже поняли, комментарии начинаются с #. Shebang - тоже комментарий.\n+\n+# Простой пример hello world:\n+echo Hello world!\n+\n+# Отдельные команды начинаются с новой строки или разделяются точкой с запятой:\n+echo 'Это первая строка'; echo 'Это вторая строка'\n+\n+# Вот так объявляется переменная:\n+VARIABLE=\"Просто строка\"\n+\n+# но не так:\n+VARIABLE = \"Просто строка\"\n+# Bash решит, что VARIABLE - это команда, которую он должен исполнить,\n+# и выдаст ошибку, потому что не сможет найти ее.\n+\n+# и не так:\n+VARIABLE= 'Просто строка'\n+# Тут Bash решит, что 'Просто строка' - это команда, которую он должен исполнить,\n+# и выдаст ошибку, потому что не сможет найти такой команды\n+# (здесь 'VARIABLE=' выглядит как присвоение значения переменной,\n+# но только в контексте исполнения команды 'Просто строка').\n+\n+# Использование переменой:\n+echo $VARIABLE\n+echo \"$VARIABLE\"\n+echo '$VARIABLE'\n+# Когда вы используете переменную - присвоение, экспорт и т.д - пишите её\n+# имя без $. А для получения значения переменной, используйте $.\n+# Заметте что ' (одинарные кавычки) не раскрывают переменные в них.\n+\n+# Подстановка строк в переменные\n+echo ${VARIABLE/Просто/A}\n+# Это выражение заменит первую встреченную подстроку \"Просто\" на \"A\"\n+\n+# Подстановка из переменной\n+LENGTH=7\n+echo ${VARIABLE:0:LENGTH}\n+# Это выражение вернет только первые 7 символов переменной VARIABLE\n+\n+# Значение по умолчанию\n+echo ${FOO:-\"DefaultValueIfFOOIsMissingOrEmpty\"}\n+# Это сработает при отсутствующем значении (FOO=) и пустой строке (FOO=\"\");\n+# ноль (FOO=0) вернет 0.\n+# Заметте, что в любом случае значение самой переменной FOO не изменится.\n+\n+# Встроенные переменные:\n+# В bash есть полезные встроенные переменные, например\n+echo \"Последее возвращенное значение: $?\"\n+echo \"PID скрипта: $$\"\n+echo \"Количество аргументов: $#\"\n+echo \"Аргументы скрипта: $@\"\n+echo \"Аргументы скрипта рапределенные по отдельным переменным: $1 $2...\"\n+\n+# Чтение аргументов из входа:\n+echo \"Как Вас зовут?\"\n+read NAME # Заметте, что нам не нужно определять новую переменную\n+echo Привет, $NAME!\n+\n+# У нас есть обычная структура if:\n+# наберите 'man test' для подробностях о форматах условия","path":"ru-ru/bash-ru.html.markdown","position":89,"original_position":89,"commit_id":"bdf4636d2302bb7ff84e105cdfeb25e7e3e6fa92","original_commit_id":"bdf4636d2302bb7ff84e105cdfeb25e7e3e6fa92","user":{"login":"Oire","id":595597,"avatar_url":"https://avatars.githubusercontent.com/u/595597?v=3","gravatar_id":"","url":"https://api.github.com/users/Oire","html_url":"https://github.com/Oire","followers_url":"https://api.github.com/users/Oire/followers","following_url":"https://api.github.com/users/Oire/following{/other_user}","gists_url":"https://api.github.com/users/Oire/gists{/gist_id}","starred_url":"https://api.github.com/users/Oire/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Oire/subscriptions","organizations_url":"https://api.github.com/users/Oire/orgs","repos_url":"https://api.github.com/users/Oire/repos","events_url":"https://api.github.com/users/Oire/events{/privacy}","received_events_url":"https://api.github.com/users/Oire/received_events","type":"User","site_admin":false},"body":"для подробной информации?","created_at":"2015-05-24T13:57:03Z","updated_at":"2015-05-24T13:57:03Z","html_url":"https://github.com/adambard/learnxinyminutes-docs/pull/1081#discussion_r30952674","pull_request_url":"https://api.github.com/repos/adambard/learnxinyminutes-docs/pulls/1081","_links":{"self":{"href":"https://api.github.com/repos/adambard/learnxinyminutes-docs/pulls/comments/30952674"},"html":{"href":"https://github.com/adambard/learnxinyminutes-docs/pull/1081#discussion_r30952674"},"pull_request":{"href":"https://api.github.com/repos/adambard/learnxinyminutes-docs/pulls/1081"}}},"pull_request":{"url":"https://api.github.com/repos/adambard/learnxinyminutes-docs/pulls/1081","id":34591085,"html_url":"https://github.com/adambard/learnxinyminutes-docs/pull/1081","diff_url":"https://github.com/adambard/learnxinyminutes-docs/pull/1081.diff","patch_url":"https://github.com/adambard/learnxinyminutes-docs/pull/1081.patch","issue_url":"https://api.github.com/repos/adambard/learnxinyminutes-docs/issues/1081","number":1081,"state":"open","locked":false,"title":"Bash translation into Russian","user":{"login":"kryzhovnik","id":283380,"avatar_url":"https://avatars.githubusercontent.com/u/283380?v=3","gravatar_id":"","url":"https://api.github.com/users/kryzhovnik","html_url":"https://github.com/kryzhovnik","followers_url":"https://api.github.com/users/kryzhovnik/followers","following_url":"https://api.github.com/users/kryzhovnik/following{/other_user}","gists_url":"https://api.github.com/users/kryzhovnik/gists{/gist_id}","starred_url":"https://api.github.com/users/kryzhovnik/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kryzhovnik/subscriptions","organizations_url":"https://api.github.com/users/kryzhovnik/orgs","repos_url":"https://api.github.com/users/kryzhovnik/repos","events_url":"https://api.github.com/users/kryzhovnik/events{/privacy}","received_events_url":"https://api.github.com/users/kryzhovnik/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-05-02T20:19:42Z","updated_at":"2015-05-24T13:57:03Z","closed_at":null,"merged_at":null,"merge_commit_sha":"55352f6ffd576eb37feae5cdd7a60c2ea3281eec","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/adambard/learnxinyminutes-docs/pulls/1081/commits","review_comments_url":"https://api.github.com/repos/adambard/learnxinyminutes-docs/pulls/1081/comments","review_comment_url":"https://api.github.com/repos/adambard/learnxinyminutes-docs/pulls/comments{/number}","comments_url":"https://api.github.com/repos/adambard/learnxinyminutes-docs/issues/1081/comments","statuses_url":"https://api.github.com/repos/adambard/learnxinyminutes-docs/statuses/bdf4636d2302bb7ff84e105cdfeb25e7e3e6fa92","head":{"label":"kryzhovnik:bash/ru","ref":"bash/ru","sha":"bdf4636d2302bb7ff84e105cdfeb25e7e3e6fa92","user":{"login":"kryzhovnik","id":283380,"avatar_url":"https://avatars.githubusercontent.com/u/283380?v=3","gravatar_id":"","url":"https://api.github.com/users/kryzhovnik","html_url":"https://github.com/kryzhovnik","followers_url":"https://api.github.com/users/kryzhovnik/followers","following_url":"https://api.github.com/users/kryzhovnik/following{/other_user}","gists_url":"https://api.github.com/users/kryzhovnik/gists{/gist_id}","starred_url":"https://api.github.com/users/kryzhovnik/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kryzhovnik/subscriptions","organizations_url":"https://api.github.com/users/kryzhovnik/orgs","repos_url":"https://api.github.com/users/kryzhovnik/repos","events_url":"https://api.github.com/users/kryzhovnik/events{/privacy}","received_events_url":"https://api.github.com/users/kryzhovnik/received_events","type":"User","site_admin":false},"repo":{"id":34943825,"name":"learnxinyminutes-docs","full_name":"kryzhovnik/learnxinyminutes-docs","owner":{"login":"kryzhovnik","id":283380,"avatar_url":"https://avatars.githubusercontent.com/u/283380?v=3","gravatar_id":"","url":"https://api.github.com/users/kryzhovnik","html_url":"https://github.com/kryzhovnik","followers_url":"https://api.github.com/users/kryzhovnik/followers","following_url":"https://api.github.com/users/kryzhovnik/following{/other_user}","gists_url":"https://api.github.com/users/kryzhovnik/gists{/gist_id}","starred_url":"https://api.github.com/users/kryzhovnik/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kryzhovnik/subscriptions","organizations_url":"https://api.github.com/users/kryzhovnik/orgs","repos_url":"https://api.github.com/users/kryzhovnik/repos","events_url":"https://api.github.com/users/kryzhovnik/events{/privacy}","received_events_url":"https://api.github.com/users/kryzhovnik/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/kryzhovnik/learnxinyminutes-docs","description":"Code documentation written as code! How novel and totally my idea!","fork":true,"url":"https://api.github.com/repos/kryzhovnik/learnxinyminutes-docs","forks_url":"https://api.github.com/repos/kryzhovnik/learnxinyminutes-docs/forks","keys_url":"https://api.github.com/repos/kryzhovnik/learnxinyminutes-docs/keys{/key_id}","collaborators_url":"https://api.github.com/repos/kryzhovnik/learnxinyminutes-docs/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/kryzhovnik/learnxinyminutes-docs/teams","hooks_url":"https://api.github.com/repos/kryzhovnik/learnxinyminutes-docs/hooks","issue_events_url":"https://api.github.com/repos/kryzhovnik/learnxinyminutes-docs/issues/events{/number}","events_url":"https://api.github.com/repos/kryzhovnik/learnxinyminutes-docs/events","assignees_url":"https://api.github.com/repos/kryzhovnik/learnxinyminutes-docs/assignees{/user}","branches_url":"https://api.github.com/repos/kryzhovnik/learnxinyminutes-docs/branches{/branch}","tags_url":"https://api.github.com/repos/kryzhovnik/learnxinyminutes-docs/tags","blobs_url":"https://api.github.com/repos/kryzhovnik/learnxinyminutes-docs/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/kryzhovnik/learnxinyminutes-docs/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/kryzhovnik/learnxinyminutes-docs/git/refs{/sha}","trees_url":"https://api.github.com/repos/kryzhovnik/learnxinyminutes-docs/git/trees{/sha}","statuses_url":"https://api.github.com/repos/kryzhovnik/learnxinyminutes-docs/statuses/{sha}","languages_url":"https://api.github.com/repos/kryzhovnik/learnxinyminutes-docs/languages","stargazers_url":"https://api.github.com/repos/kryzhovnik/learnxinyminutes-docs/stargazers","contributors_url":"https://api.github.com/repos/kryzhovnik/learnxinyminutes-docs/contributors","subscribers_url":"https://api.github.com/repos/kryzhovnik/learnxinyminutes-docs/subscribers","subscription_url":"https://api.github.com/repos/kryzhovnik/learnxinyminutes-docs/subscription","commits_url":"https://api.github.com/repos/kryzhovnik/learnxinyminutes-docs/commits{/sha}","git_commits_url":"https://api.github.com/repos/kryzhovnik/learnxinyminutes-docs/git/commits{/sha}","comments_url":"https://api.github.com/repos/kryzhovnik/learnxinyminutes-docs/comments{/number}","issue_comment_url":"https://api.github.com/repos/kryzhovnik/learnxinyminutes-docs/issues/comments{/number}","contents_url":"https://api.github.com/repos/kryzhovnik/learnxinyminutes-docs/contents/{+path}","compare_url":"https://api.github.com/repos/kryzhovnik/learnxinyminutes-docs/compare/{base}...{head}","merges_url":"https://api.github.com/repos/kryzhovnik/learnxinyminutes-docs/merges","archive_url":"https://api.github.com/repos/kryzhovnik/learnxinyminutes-docs/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/kryzhovnik/learnxinyminutes-docs/downloads","issues_url":"https://api.github.com/repos/kryzhovnik/learnxinyminutes-docs/issues{/number}","pulls_url":"https://api.github.com/repos/kryzhovnik/learnxinyminutes-docs/pulls{/number}","milestones_url":"https://api.github.com/repos/kryzhovnik/learnxinyminutes-docs/milestones{/number}","notifications_url":"https://api.github.com/repos/kryzhovnik/learnxinyminutes-docs/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/kryzhovnik/learnxinyminutes-docs/labels{/name}","releases_url":"https://api.github.com/repos/kryzhovnik/learnxinyminutes-docs/releases{/id}","created_at":"2015-05-02T10:31:09Z","updated_at":"2015-05-02T10:31:10Z","pushed_at":"2015-05-24T12:06:41Z","git_url":"git://github.com/kryzhovnik/learnxinyminutes-docs.git","ssh_url":"git@github.com:kryzhovnik/learnxinyminutes-docs.git","clone_url":"https://github.com/kryzhovnik/learnxinyminutes-docs.git","svn_url":"https://github.com/kryzhovnik/learnxinyminutes-docs","homepage":"http://learnxinyminutes.com/","size":5644,"stargazers_count":0,"watchers_count":0,"language":"HTML","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"adambard:master","ref":"master","sha":"7f1c4293e448f9ff1e14587c189dd672ad8c19e5","user":{"login":"adambard","id":515720,"avatar_url":"https://avatars.githubusercontent.com/u/515720?v=3","gravatar_id":"","url":"https://api.github.com/users/adambard","html_url":"https://github.com/adambard","followers_url":"https://api.github.com/users/adambard/followers","following_url":"https://api.github.com/users/adambard/following{/other_user}","gists_url":"https://api.github.com/users/adambard/gists{/gist_id}","starred_url":"https://api.github.com/users/adambard/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/adambard/subscriptions","organizations_url":"https://api.github.com/users/adambard/orgs","repos_url":"https://api.github.com/users/adambard/repos","events_url":"https://api.github.com/users/adambard/events{/privacy}","received_events_url":"https://api.github.com/users/adambard/received_events","type":"User","site_admin":false},"repo":{"id":10974951,"name":"learnxinyminutes-docs","full_name":"adambard/learnxinyminutes-docs","owner":{"login":"adambard","id":515720,"avatar_url":"https://avatars.githubusercontent.com/u/515720?v=3","gravatar_id":"","url":"https://api.github.com/users/adambard","html_url":"https://github.com/adambard","followers_url":"https://api.github.com/users/adambard/followers","following_url":"https://api.github.com/users/adambard/following{/other_user}","gists_url":"https://api.github.com/users/adambard/gists{/gist_id}","starred_url":"https://api.github.com/users/adambard/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/adambard/subscriptions","organizations_url":"https://api.github.com/users/adambard/orgs","repos_url":"https://api.github.com/users/adambard/repos","events_url":"https://api.github.com/users/adambard/events{/privacy}","received_events_url":"https://api.github.com/users/adambard/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/adambard/learnxinyminutes-docs","description":"Code documentation written as code! How novel and totally my idea!","fork":false,"url":"https://api.github.com/repos/adambard/learnxinyminutes-docs","forks_url":"https://api.github.com/repos/adambard/learnxinyminutes-docs/forks","keys_url":"https://api.github.com/repos/adambard/learnxinyminutes-docs/keys{/key_id}","collaborators_url":"https://api.github.com/repos/adambard/learnxinyminutes-docs/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/adambard/learnxinyminutes-docs/teams","hooks_url":"https://api.github.com/repos/adambard/learnxinyminutes-docs/hooks","issue_events_url":"https://api.github.com/repos/adambard/learnxinyminutes-docs/issues/events{/number}","events_url":"https://api.github.com/repos/adambard/learnxinyminutes-docs/events","assignees_url":"https://api.github.com/repos/adambard/learnxinyminutes-docs/assignees{/user}","branches_url":"https://api.github.com/repos/adambard/learnxinyminutes-docs/branches{/branch}","tags_url":"https://api.github.com/repos/adambard/learnxinyminutes-docs/tags","blobs_url":"https://api.github.com/repos/adambard/learnxinyminutes-docs/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/adambard/learnxinyminutes-docs/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/adambard/learnxinyminutes-docs/git/refs{/sha}","trees_url":"https://api.github.com/repos/adambard/learnxinyminutes-docs/git/trees{/sha}","statuses_url":"https://api.github.com/repos/adambard/learnxinyminutes-docs/statuses/{sha}","languages_url":"https://api.github.com/repos/adambard/learnxinyminutes-docs/languages","stargazers_url":"https://api.github.com/repos/adambard/learnxinyminutes-docs/stargazers","contributors_url":"https://api.github.com/repos/adambard/learnxinyminutes-docs/contributors","subscribers_url":"https://api.github.com/repos/adambard/learnxinyminutes-docs/subscribers","subscription_url":"https://api.github.com/repos/adambard/learnxinyminutes-docs/subscription","commits_url":"https://api.github.com/repos/adambard/learnxinyminutes-docs/commits{/sha}","git_commits_url":"https://api.github.com/repos/adambard/learnxinyminutes-docs/git/commits{/sha}","comments_url":"https://api.github.com/repos/adambard/learnxinyminutes-docs/comments{/number}","issue_comment_url":"https://api.github.com/repos/adambard/learnxinyminutes-docs/issues/comments{/number}","contents_url":"https://api.github.com/repos/adambard/learnxinyminutes-docs/contents/{+path}","compare_url":"https://api.github.com/repos/adambard/learnxinyminutes-docs/compare/{base}...{head}","merges_url":"https://api.github.com/repos/adambard/learnxinyminutes-docs/merges","archive_url":"https://api.github.com/repos/adambard/learnxinyminutes-docs/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/adambard/learnxinyminutes-docs/downloads","issues_url":"https://api.github.com/repos/adambard/learnxinyminutes-docs/issues{/number}","pulls_url":"https://api.github.com/repos/adambard/learnxinyminutes-docs/pulls{/number}","milestones_url":"https://api.github.com/repos/adambard/learnxinyminutes-docs/milestones{/number}","notifications_url":"https://api.github.com/repos/adambard/learnxinyminutes-docs/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/adambard/learnxinyminutes-docs/labels{/name}","releases_url":"https://api.github.com/repos/adambard/learnxinyminutes-docs/releases{/id}","created_at":"2013-06-26T17:58:34Z","updated_at":"2015-05-23T14:48:22Z","pushed_at":"2015-05-24T12:06:42Z","git_url":"git://github.com/adambard/learnxinyminutes-docs.git","ssh_url":"git@github.com:adambard/learnxinyminutes-docs.git","clone_url":"https://github.com/adambard/learnxinyminutes-docs.git","svn_url":"https://github.com/adambard/learnxinyminutes-docs","homepage":"http://learnxinyminutes.com/","size":12023,"stargazers_count":2437,"watchers_count":2437,"language":"HTML","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":804,"mirror_url":null,"open_issues_count":60,"forks":804,"open_issues":60,"watchers":2437,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/adambard/learnxinyminutes-docs/pulls/1081"},"html":{"href":"https://github.com/adambard/learnxinyminutes-docs/pull/1081"},"issue":{"href":"https://api.github.com/repos/adambard/learnxinyminutes-docs/issues/1081"},"comments":{"href":"https://api.github.com/repos/adambard/learnxinyminutes-docs/issues/1081/comments"},"review_comments":{"href":"https://api.github.com/repos/adambard/learnxinyminutes-docs/pulls/1081/comments"},"review_comment":{"href":"https://api.github.com/repos/adambard/learnxinyminutes-docs/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/adambard/learnxinyminutes-docs/pulls/1081/commits"},"statuses":{"href":"https://api.github.com/repos/adambard/learnxinyminutes-docs/statuses/bdf4636d2302bb7ff84e105cdfeb25e7e3e6fa92"}}}}