{"id":672,"date":"2016-09-15T08:08:58","date_gmt":"2016-09-15T13:08:58","guid":{"rendered":"http:\/\/annapolislinux.org\/?p=672"},"modified":"2016-12-05T21:56:44","modified_gmt":"2016-12-06T02:56:44","slug":"oct-3-2016-bash-talk-scheduled","status":"publish","type":"post","link":"https:\/\/annapolislinux.org\/?p=672","title":{"rendered":"Oct 3 2016 &#8211; Bash Talk past"},"content":{"rendered":"<p>Speaker: Dr. Carl Albing<br \/>\nSubject: Bash<\/p>\n<p>$x=&#8217;ls&#8217;<br \/>\n$x=$(ls)<\/p>\n<p>echo $x<br \/>\nprintf &#8220;&#8230;.%s..%05d\\n&#8221;<\/p>\n<p>loops<br \/>\nwhile read aline<br \/>\ndo<br \/>\n.<br \/>\n.<br \/>\n.<br \/>\ndone<\/p>\n<p>echo $? to see if things were successful<\/p>\n<p>$? &#8212; get results<\/p>\n<p>cd \/tmp\/mytmp || exit -2<\/p>\n<p>rm $filename<\/p>\n<p>cp \/tmp\/mytmp || {echo &#8220;error: can not cd&#8221;; exit }<br \/>\nrm $filename<\/p>\n<p>cd \/tmp\/mytmp &#038;&#038; rm $filname<br \/>\nexit<\/p>\n<p>#spaces mean variables don&#8217;t get assigned.<br \/>\nVAR=&#8221;\/usr\/local\/bin\/a.out&#8221;<br \/>\nD1=$(dirname $VAR)<br \/>\nD1=${VAR %.out}<br \/>\nD1=${VAR %\/*}<br \/>\nB1=${VAR ##*}<br \/>\nL1=${VAR\/local\\\/}<br \/>\nexport L1<\/p>\n<p>Location: IJET 3rd Floor, 185 Admiral Cochrane Dr, Annapolis MD<br \/>\nTime\/Date: 7PM 1st Monday of Month 10\/3\/2016<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Speaker: Dr. Carl Albing Subject: Bash $x=&#8217;ls&#8217; $x=$(ls) echo $x printf &#8220;&#8230;.%s..%05d\\n&#8221; loops while read aline do . . . done echo $? to see if things were successful $? &#8212; get results cd \/tmp\/mytmp || exit -2 rm $filename cp \/tmp\/mytmp || {echo &#8220;error: can not cd&#8221;; exit } rm $filename cd \/tmp\/mytmp &#038;&#038; [&hellip;] <a class=\"read-more\" href=\"https:\/\/annapolislinux.org\/?p=672\" title=\"Permanent Link to: Oct 3 2016 &#8211; Bash Talk past\">&rarr;Read&nbsp;more<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-672","post","type-post","status-publish","format-standard","hentry","category-info"],"_links":{"self":[{"href":"https:\/\/annapolislinux.org\/index.php?rest_route=\/wp\/v2\/posts\/672","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/annapolislinux.org\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/annapolislinux.org\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/annapolislinux.org\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/annapolislinux.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=672"}],"version-history":[{"count":4,"href":"https:\/\/annapolislinux.org\/index.php?rest_route=\/wp\/v2\/posts\/672\/revisions"}],"predecessor-version":[{"id":694,"href":"https:\/\/annapolislinux.org\/index.php?rest_route=\/wp\/v2\/posts\/672\/revisions\/694"}],"wp:attachment":[{"href":"https:\/\/annapolislinux.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=672"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/annapolislinux.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=672"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/annapolislinux.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=672"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}