{"action":"closed","issue":{"url":"https://api.github.com/repos/mortonwilliam/stat679work/issues/2","repository_url":"https://api.github.com/repos/mortonwilliam/stat679work","labels_url":"https://api.github.com/repos/mortonwilliam/stat679work/issues/2/labels{/name}","comments_url":"https://api.github.com/repos/mortonwilliam/stat679work/issues/2/comments","events_url":"https://api.github.com/repos/mortonwilliam/stat679work/issues/2/events","html_url":"https://github.com/mortonwilliam/stat679work/issues/2","id":183226661,"number":2,"title":"Mark homework 1, exercise 3 of William-Morton","user":{"login":"mortonwilliam","id":22064972,"avatar_url":"https://avatars.githubusercontent.com/u/22064972?v=3","gravatar_id":"","url":"https://api.github.com/users/mortonwilliam","html_url":"https://github.com/mortonwilliam","followers_url":"https://api.github.com/users/mortonwilliam/followers","following_url":"https://api.github.com/users/mortonwilliam/following{/other_user}","gists_url":"https://api.github.com/users/mortonwilliam/gists{/gist_id}","starred_url":"https://api.github.com/users/mortonwilliam/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mortonwilliam/subscriptions","organizations_url":"https://api.github.com/users/mortonwilliam/orgs","repos_url":"https://api.github.com/users/mortonwilliam/repos","events_url":"https://api.github.com/users/mortonwilliam/events{/privacy}","received_events_url":"https://api.github.com/users/mortonwilliam/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":4,"created_at":"2016-10-15T19:02:51Z","updated_at":"2016-11-20T05:47:39Z","closed_at":"2016-11-20T05:47:39Z","body":"8cd6676c\n\n@cecileane \n\nhi, here is part three of the homework. I was not sure you wanted the whole code below but just in case! here it is (some parts are still not the best).\n\n``` shell\n\necho basename, hmax, CPUtime, Nruns, Nfail, fabs, frel, xabs, xrel, Seed, under3460, under3450, under3440 >> wmortonhw1.csv\nfor filename in log/*.log\ndo\n\n  Basename=$(echo \"${filename}\" | grep -o -E \"[^/]+$\" | grep -o -E \"^[^.]+\")\n  #gives filenames\n  Hmax=$(grep -E -o 'hmax = [0-9]+' log/${Basename}.log | head -n 1 | grep -E -o '\\d+')\n  #hmax values from log files\n  CPUTime=$(grep -E -o 'Elapsed time. \\d+\\.\\d+' out/${Basename}.out | grep -E -o '\\d+\\.\\d+')\n  #gives all digits for CPUTime before and then after \".\"\n  Nruns=$(sed -n 'runs = [0-9]+' $filename | tail -n 1  | grep -o -E '\\d+')\n  #\"max number of failed proposals\"\n  #still can get this one to work?\n  Nfail=$(sed -n '5p' $filename | grep -o -E 'proposals\\s=\\s\\d+' | grep -o -E \"\\d+\")\n  #max number of failed proposals\n  Seed=$(grep \"main seed\" $filename  | grep -E -o \"\\d+\")\n  #main seed/seed for the first runs\n  frel=$(sed -n '3p' $filename | cut -f4 -d\" \" | grep -E -o \"\\d+.+\\d+\")\n  #ftolRel for each analysis\n  fabs=$(sed -n '3p' $filename | cut -f5 -d\" \" | grep -E -o \"\\d+.+\\d+\")\n  #ftolAbs in the log file\n  xabs=$(sed -n '4p' $filename | cut -f1 -d \",\" | grep -E -o \"\\d+.+\\d+\")\n  #xtolABS for each analysis\n  xrel=$(sed -n '4p' $filename | cut -f2 -d \",\" | grep -E -o \"\\d+.+\\d+\")\n  #xtolRel for each analysis\n\nloglik=$(grep \"loglik of best\" $filename | cut -f10 -d \" \" | cut -f1 -d.)\ni1=5000\ni2=5000\ni3=5000\nfor lik in $loglik\ndo\n  if [ $lik -lt 3460 ]\n  then\n    echo \"i is less than 5000\"\n  fi\n\n  if [ $lik -lt 3450 ]\n  then\n    echo \"i is less than 5000\"\n  fi\n\n  if [ $lik -lt 3440 ]\n  then\n  echo \"i is less than 5000\"\n  fi\ndone\n#loops still dont work\n  echo \"$Basename, $Hmax, $CPUTime, $Nruns, $Nfail, $fabs, $frel, $xabs, $xrel, $Seed, $under3460, $under3450, $under3440\"  >> wmortonhw1.csv\ndone\n\n```\n\n**done**!\n"}}
{"actor":{"display_login":"cecileane"}}