{"action":"created","issue":{"url":"https://api.github.com/repos/ngsutils/ngsutils/issues/12","repository_url":"https://api.github.com/repos/ngsutils/ngsutils","labels_url":"https://api.github.com/repos/ngsutils/ngsutils/issues/12/labels{/name}","comments_url":"https://api.github.com/repos/ngsutils/ngsutils/issues/12/comments","events_url":"https://api.github.com/repos/ngsutils/ngsutils/issues/12/events","html_url":"https://github.com/ngsutils/ngsutils/issues/12","id":59974961,"number":12,"title":"Use bash instead of sh in shell scripts","user":{"login":"ghuls","id":1299177,"avatar_url":"https://avatars.githubusercontent.com/u/1299177?v=3","gravatar_id":"","url":"https://api.github.com/users/ghuls","html_url":"https://github.com/ghuls","followers_url":"https://api.github.com/users/ghuls/followers","following_url":"https://api.github.com/users/ghuls/following{/other_user}","gists_url":"https://api.github.com/users/ghuls/gists{/gist_id}","starred_url":"https://api.github.com/users/ghuls/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ghuls/subscriptions","organizations_url":"https://api.github.com/users/ghuls/orgs","repos_url":"https://api.github.com/users/ghuls/repos","events_url":"https://api.github.com/users/ghuls/events{/privacy}","received_events_url":"https://api.github.com/users/ghuls/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-03-05T16:18:53Z","updated_at":"2016-05-07T17:55:53Z","closed_at":"2016-05-07T17:55:53Z","body":"Use bash instead of sh in shell scripts.\r\n\r\nDebian/Ubuntu uses dash instead of bash as default shell for scripts (/bin/sh is symlink to /bin/dash).\r\n\r\nSo a lot of scripts don't work with dash (it does not like for example == in [ ] tags):\r\n```\r\n$ sh ./bin/ngsutils\r\n./bin/ngsutils: 22: [: unexpected operator\r\n./bin/ngsutils: 30: [: ngs: unexpected operator\r\n./bin/ngsutils: 59: [: unexpected operator\r\n./bin/ngsutils: 75: [: unexpected operator\r\n./bin/ngsutils: 81: [: unexpected operator\r\nUnknown command ''\r\nghuls@SEQ-SRV-03:/software/ngsutils/ngsutils-git [17:14] $ bash ./bin/ngsutils\r\nUsage: ngsutils COMMAND\r\n\r\nCommands\r\n    update        - Updates NGSUtils from git repository \r\n                    (http://github.com/ngsutils/ngsutils)\r\n    repeat2fasta  - Extract repeatmasker flagged regions to a FASTA file\r\n    strip_fasta   - Remove sequences from a FASTA file based on name\r\n    tag_fasta     - Tag FASTA sequence names with a prefix or suffix\r\n    tabixindex    - Index a tab-delimited file using Tabix and bgzip\r\n\r\n\r\nRun 'ngsutils help CMD' for more information about a specific command\r\nngsutils 0.5.7-ddceb14\r\n```\r\nAll files with /bin/sh that should be /bin/bash:\r\n```diff\r\n$ git diff\r\ndiff --git a/bin/ngsutils b/bin/ngsutils\r\nindex a3bdfa0..1b64a79 100755\r\n--- a/bin/ngsutils\r\n+++ b/bin/ngsutils\r\n@@ -1,4 +1,4 @@\r\n-#!/bin/sh\r\n+#!/bin/bash\r\n REAL=`python -c 'import os,sys;print os.path.realpath(sys.argv[1])' \"$0\"`\r\n DIR=`dirname \"$REAL\"`/../\r\n SUBDIR=$(basename $0 | sed -e 's/utils//')\r\ndiff --git a/init.sh b/init.sh\r\nindex 96e3ee9..5e0e7e1 100755\r\n--- a/init.sh\r\n+++ b/init.sh\r\n@@ -1,4 +1,4 @@\r\n-#!/bin/sh\r\n+#!/bin/bash\r\n \r\n if [ \"$PYTHON\" == \"\" ]; then\r\n     PYTHON=\"python\"\r\n```"},"comment":{"url":"https://api.github.com/repos/ngsutils/ngsutils/issues/comments/217656197","html_url":"https://github.com/ngsutils/ngsutils/issues/12#issuecomment-217656197","issue_url":"https://api.github.com/repos/ngsutils/ngsutils/issues/12","id":217656197,"user":{"login":"mbreese","id":98979,"avatar_url":"https://avatars.githubusercontent.com/u/98979?v=3","gravatar_id":"","url":"https://api.github.com/users/mbreese","html_url":"https://github.com/mbreese","followers_url":"https://api.github.com/users/mbreese/followers","following_url":"https://api.github.com/users/mbreese/following{/other_user}","gists_url":"https://api.github.com/users/mbreese/gists{/gist_id}","starred_url":"https://api.github.com/users/mbreese/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mbreese/subscriptions","organizations_url":"https://api.github.com/users/mbreese/orgs","repos_url":"https://api.github.com/users/mbreese/repos","events_url":"https://api.github.com/users/mbreese/events{/privacy}","received_events_url":"https://api.github.com/users/mbreese/received_events","type":"User","site_admin":false},"created_at":"2016-05-07T17:55:53Z","updated_at":"2016-05-07T17:55:53Z","body":"Should have been fixed with a prior commit."}}