{"id":146,"date":"2014-03-04T14:57:00","date_gmt":"2014-03-04T13:57:00","guid":{"rendered":"https:\/\/kszyh.kisim.eu.org\/?p=146"},"modified":"2014-03-04T14:57:00","modified_gmt":"2014-03-04T13:57:00","slug":"trywialne-kolejkowanie-zadan-w-screenie-inaczej","status":"publish","type":"post","link":"https:\/\/kszyh.kisim.eu.org\/?p=146","title":{"rendered":"Trywialne kolejkowanie zada\u0144 w screenie &#8211; inaczej"},"content":{"rendered":"<pre class=\"lang:sh\" title=\"Bash script\">#!\/bin\/bash\r\nif [ $# -eq 0 ]\r\n  then\r\n    echo \"No arguments supplied\"\r\n    exit 0\r\nfi\r\n\r\ninputs=()\r\nfor f in *.pts; do\r\n   inputs+=($f)\r\ndone\r\n\r\necho ${inputs[@]}\r\narrSize=${#inputs[@]}\r\necho $arrSize\r\n\r\ndiv=$(($1-1))\r\n\r\nile=$(($arrSize \/ $div))\r\nfor i in $(eval echo {0..$div}); do\r\n   echo \"Thread\/Screen: $i\"\r\n   inp=${inputs[$i]}\r\n   ff=`echo $inp | sed 's\/_\/\/' | sed 's\/\\.\/\/' | sed 's\/pts\/\/'`\r\n   ff=project$ff\r\n   screen -md -S \"calc$i\"\r\n   fin=$(($div+1))\r\n   command=\"for c in \"\r\n   for j in $(eval echo {$i..$arrSize..$fin}); do\r\n      command+=\"$name \"\r\n      name=${inputs[$j]}\r\n   done\r\n   command+=\"; do module load deal.ii\/8.2pre-gcc482 &&.\/Femaft \\$c; done \"\r\n   echo $command\r\n   screen -S \"calc$i\" -p 0 -X stuff \"$command $(printf \\\\r) \"\r\n\r\ndone\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>#!\/bin\/bash if [ $# -eq 0 ] then echo &#8222;No arguments supplied&#8221; exit 0 fi inputs=() for f in *.pts; do inputs+=($f) done echo ${inputs[@]} arrSize=${#inputs[@]} echo $arrSize div=$(($1-1)) ile=$(($arrSize \/ $div)) for i in $(eval echo {0..$div}); do echo &#8222;Thread\/Screen: $i&#8221; inp=${inputs[$i]} ff=`echo $inp | sed 's\/_\/\/&#8217; | sed&#8230; <a class=\"continue-reading-link\" href=\"https:\/\/kszyh.kisim.eu.org\/?p=146\"> Continue reading <span class=\"meta-nav\">&rarr; <\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[9,23,19],"tags":[20,42],"class_list":["post-146","post","type-post","status-publish","format-standard","hentry","category-lifehacking","category-linux","category-skrypty","tag-bash","tag-screen"],"_links":{"self":[{"href":"https:\/\/kszyh.kisim.eu.org\/index.php?rest_route=\/wp\/v2\/posts\/146","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/kszyh.kisim.eu.org\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/kszyh.kisim.eu.org\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/kszyh.kisim.eu.org\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/kszyh.kisim.eu.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=146"}],"version-history":[{"count":2,"href":"https:\/\/kszyh.kisim.eu.org\/index.php?rest_route=\/wp\/v2\/posts\/146\/revisions"}],"predecessor-version":[{"id":148,"href":"https:\/\/kszyh.kisim.eu.org\/index.php?rest_route=\/wp\/v2\/posts\/146\/revisions\/148"}],"wp:attachment":[{"href":"https:\/\/kszyh.kisim.eu.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=146"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/kszyh.kisim.eu.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=146"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/kszyh.kisim.eu.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=146"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}