{"action":"closed","issue":{"url":"https://api.github.com/repos/bablokb/pi-boot-switch/issues/1","repository_url":"https://api.github.com/repos/bablokb/pi-boot-switch","labels_url":"https://api.github.com/repos/bablokb/pi-boot-switch/issues/1/labels{/name}","comments_url":"https://api.github.com/repos/bablokb/pi-boot-switch/issues/1/comments","events_url":"https://api.github.com/repos/bablokb/pi-boot-switch/issues/1/events","html_url":"https://github.com/bablokb/pi-boot-switch/issues/1","id":298165075,"number":1,"title":"Some code-parts not working","user":{"login":"gneiss15","id":36615981,"avatar_url":"https://avatars1.githubusercontent.com/u/36615981?v=4","gravatar_id":"","url":"https://api.github.com/users/gneiss15","html_url":"https://github.com/gneiss15","followers_url":"https://api.github.com/users/gneiss15/followers","following_url":"https://api.github.com/users/gneiss15/following{/other_user}","gists_url":"https://api.github.com/users/gneiss15/gists{/gist_id}","starred_url":"https://api.github.com/users/gneiss15/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gneiss15/subscriptions","organizations_url":"https://api.github.com/users/gneiss15/orgs","repos_url":"https://api.github.com/users/gneiss15/repos","events_url":"https://api.github.com/users/gneiss15/events{/privacy}","received_events_url":"https://api.github.com/users/gneiss15/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":{"login":"bablokb","id":9638355,"avatar_url":"https://avatars3.githubusercontent.com/u/9638355?v=4","gravatar_id":"","url":"https://api.github.com/users/bablokb","html_url":"https://github.com/bablokb","followers_url":"https://api.github.com/users/bablokb/followers","following_url":"https://api.github.com/users/bablokb/following{/other_user}","gists_url":"https://api.github.com/users/bablokb/gists{/gist_id}","starred_url":"https://api.github.com/users/bablokb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bablokb/subscriptions","organizations_url":"https://api.github.com/users/bablokb/orgs","repos_url":"https://api.github.com/users/bablokb/repos","events_url":"https://api.github.com/users/bablokb/events{/privacy}","received_events_url":"https://api.github.com/users/bablokb/received_events","type":"User","site_admin":false},"assignees":[{"login":"bablokb","id":9638355,"avatar_url":"https://avatars3.githubusercontent.com/u/9638355?v=4","gravatar_id":"","url":"https://api.github.com/users/bablokb","html_url":"https://github.com/bablokb","followers_url":"https://api.github.com/users/bablokb/followers","following_url":"https://api.github.com/users/bablokb/following{/other_user}","gists_url":"https://api.github.com/users/bablokb/gists{/gist_id}","starred_url":"https://api.github.com/users/bablokb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bablokb/subscriptions","organizations_url":"https://api.github.com/users/bablokb/orgs","repos_url":"https://api.github.com/users/bablokb/repos","events_url":"https://api.github.com/users/bablokb/events{/privacy}","received_events_url":"https://api.github.com/users/bablokb/received_events","type":"User","site_admin":false}],"milestone":null,"comments":2,"created_at":"2018-02-19T05:28:40Z","updated_at":"2018-02-21T16:32:37Z","closed_at":"2018-02-21T16:32:37Z","author_association":"NONE","body":"You use somthing like this (in some places):\r\nlocal currentRoot=$(mount | grep -w / | cut -f1 -d\" \")\r\nThis will not result in the desired result, if \"mount\" will return a line like:\r\n//\\<ip>/\\<path> on /mnt/\\<path> type cifs ....\r\n(That are my mounts of Network storage)\r\nIn generell I wouldn't use grep with option -w if the search string isn't a word.\r\nThis will result in an incorrect result if there is a \"/\" followed by another char that isn't a alphanum or underscore. (here the two // will form a match)\r\n\r\nOne solution might be:\r\nlocal currentRoot=$(mount | grep \" / \" | cut -f1 -d\" \")\r\n\r\nbut this is only for this special case, So I would sugest this:\r\nlocal currentRoot=$(mount | sed -n \"/\\W\\/\\W/s/\\(^[^ \\t]*\\).*/\\1/p\")\r\n\r\nThis is \"smaller/faster\", because it use only one external function (sed) instead of grep and cut.\r\nAnd You use this kind of search at other places, too.\r\n"}}
{"actor":{"display_login":"bablokb"}}