{"id":46503,"date":"2019-09-24T03:01:29","date_gmt":"2019-09-23T17:01:29","guid":{"rendered":"http:\/\/www.rjmprogramming.com.au\/ITblog\/?p=46503"},"modified":"2019-09-23T21:06:25","modified_gmt":"2019-09-23T11:06:25","slug":"sass-css-stylesheet-background-crontab-tutorial","status":"publish","type":"post","link":"https:\/\/www.rjmprogramming.com.au\/ITblog\/sass-css-stylesheet-background-crontab-tutorial\/","title":{"rendered":"Sass CSS Stylesheet Background Crontab Tutorial"},"content":{"rendered":"<div style=\"width: 230px\" class=\"wp-caption alignnone\"><a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/Mac\/sass_crontab.pdf\"><img decoding=\"async\" style=\"border: 15px solid pink;\" alt=\"Sass CSS Stylesheet Background Crontab Tutorial\" src=\"http:\/\/www.rjmprogramming.com.au\/Mac\/sass_crontab.jpg\" title=\"Sass CSS Stylesheet Background Crontab Tutorial\"  style=\"float:left;\"   \/><\/a><p class=\"wp-caption-text\">Sass CSS Stylesheet Background Crontab Tutorial<\/p><\/div>\n<p>Yesterday&#8217;s <a title='Sass CSS Stylesheet Primer Tutorial' href='#scssspt'>Sass CSS Stylesheet Primer Tutorial<\/a> showed a really promising procedural CSS stylesheet creator tool &#8230;<\/p>\n<p><code><br \/>\nsass --watch [inputSassSCSS] [outputCSS]<br \/>\n<\/code><\/p>\n<p> &#8230; in action, but the mode of that procedural application of that &#8230;<\/p>\n<ul>\n<li>sass &#8211;watch [inputSassSCSS] [outputCSS]     # in a Mac OS X (or macOS) terminal window command line &#8230; held up the further use of that window, because it is a foreground process &#8230; and so jarred with us &#8230; but today&#8217;s work, good for Linux and\/or Mac OS X (or macOS) &#8230; and which you can see in action with today&#8217;s <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/Mac\/sass_crontab.pdf\" title=\"Click picture\">PDF slideshow<\/a> &#8230; allows for &#8230;<\/li>\n<li>Linux or Mac OS X (or macOS) &#8230;\n<ol>\n<li>sass &#8211;watch [inputSassSCSS] [outputCSS] &#038;   # in a Mac OS X (or macOS) terminal window command line run as a background process that remains even after logout, which is mostly all you need, except that &#8220;sass &#8211;watch&#8221; process can fallover &#8230; so &#8230;<\/li>\n<li><a target=_blank title='crontab' href='http:\/\/www.hscripts.com\/tutorials\/linux-commands\/crontab.html'>crontab<\/a> controlled Sass &#8220;watchdog&#8221; (remember <a target=_blank href='https:\/\/www.rjmprogramming.com.au\/ITblog\/linux-watchdog-primer-tutorial\/' title='Linux Watchdog Primer Tutorial'>Linux Watchdog Primer Tutorial<\/a>) &#8230; that checks on whether Sass &#8220;watchdog&#8221; is running, and whether a (CSS stylesheet) file set check instance execution is running &#8230;<br \/>\n<code><br \/>\n#!\/bin\/ksh<br \/>\n# supervise_sass.ksh<br \/>\n# RJM Programming<br \/>\n# Make sure \"sass --watch base.scss build\/test.css\" is running<br \/>\nif [ -z \"`ps -ef | grep -v 'grep' | grep -c 'supervise_sass.ksh' | sed '\/10\/s\/\/21\/g' | sed '\/1\/s\/\/\/g' | sed '\/0\/s\/\/\/g'`\" ]; then<br \/>\n  while [ 0 -lt 1 ]; do<br \/>\n    if [ -z \"`ps -ef | grep -c 'build\/test.css' | sed '\/10\/s\/\/21\/g' | sed '\/1\/s\/\/\/g' | sed '\/0\/s\/\/\/g'`\" ]; then<br \/>\n      <b>\/usr\/local\/Cellar\/sass\/1.22.12\/bin\/sass<\/b> --watch \/Applications\/MAMP\/htdocs\/sass\/base.scss \/Applications\/MAMP\/htdocs\/sass\/build\/test.css &gt;&gt; \/Applications\/MAMP\/htdocs\/sass\/sass_watch.ok 2&gt;&gt; \/Applications\/MAMP\/htdocs\/sass\/sass_watch.notok &<br \/>\n    fi<br \/>\n    sleep 10<br \/>\n  done<br \/>\nfi<br \/>\nexit<br \/>\n<\/code><br \/>\n &#8230; (a Sass &#8220;watchdog&#8221;) called <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/Mac\/supervise_sass.ksh_GETME\" title=\"supervise_sass.ksh\">supervise_sass.ksh<\/a> &#8230; via &#8230; crontab -l &#8230;<br \/>\n<code><br \/>\n* * * * * ksh -c \"\/Applications\/MAMP\/htdocs\/supervise_sass.ksh &gt;&gt; \/Applications\/MAMP\/htdocs\/ss.xxx 2&gt;&gt; \/Applications\/MAMP\/htdocs\/ss.notxxx\"<br \/>\n<\/code><br \/>\n &#8230; and note how what &#8220;sass&#8221; represents (in commands) needed to be written in <b>&#8220;longhand path terms&#8221;<\/b> in crontab land, because you should not assume anything about the environment associated with crontab\n<\/li>\n<\/ol>\n<\/li>\n<\/ul>\n<p> &#8230; which is good now &#8220;for leave it (ie. Sass CSS Stylesheet preprocessing) to look after itself, and resurrect itself&#8221;.  But tomorrow we want more genericity regarding &#8230;<\/p>\n<ul>\n<li>more Windows friendly aspects to &#8220;watchdog&#8221; talk<\/li>\n<li>allow for multiple (CSS stylesheet) file set arrangements &#8230; but also (a more thorough &#8220;watchdog&#8221; should) &#8230;<\/li>\n<li>allow for a &#8220;complete shutdown, and not resurrect&#8221; mode of use<\/li>\n<\/ul>\n<hr>\n<p id='scssspt'>Previous relevant <a target=_blank title='Sass CSS Stylesheet Primer Tutorial' href='\/\/www.rjmprogramming.com.au\/ITblog\/sass-css-stylesheet-primer-tutorial\/'>Sass CSS Stylesheet Primer Tutorial<\/a> is shown below.<\/p>\n<div style=\"width: 230px\" class=\"wp-caption alignnone\"><a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/Mac\/sass_scss.pdf\"><img decoding=\"async\" style=\"border: 15px solid pink;\" alt=\"Sass CSS Stylesheet Primer Tutorial\" src=\"http:\/\/www.rjmprogramming.com.au\/Mac\/sass_scss.jpg\" title=\"Sass CSS Stylesheet Primer Tutorial\"  style=\"float:left;\"   \/><\/a><p class=\"wp-caption-text\">Sass CSS Stylesheet Primer Tutorial<\/p><\/div>\n<p>When compartmentalizing web design work, and you&#8217;ve already done a compartmentalization to &#8230;<\/p>\n<ul>\n<li>backend &#8211; (ie. &#8220;the data&#8221;, &#8220;the configuration&#8221;) &#8230; and &#8230;<\/li>\n<li>frontend &#8211; (ie. &#8220;the look&#8221;, &#8220;the functionality&#8221;)<\/li>\n<\/ul>\n<p> &#8230; a very natural, and intuitive way to divvy up some of the tasks for &#8220;frontend&#8221; above, a programmer or developer or team could work on &#8230;<\/p>\n<p><code><br \/>\nCSS styling<br \/>\n<\/code><\/p>\n<p> &#8230; both in a &#8230;<\/p>\n<ul>\n<li>project wide CSS styling sense &#8230; and into &#8230;<\/li>\n<li>nuances for exceptional webpages, perhaps<\/li>\n<\/ul>\n<p> &#8230; and it is here that we think today&#8217;s (&#8220;Hello World&#8221;-ish) trial of the <a target=_blank title='Sass Syntactically Awesome Style Sheets' href='http:\/\/sass-lang.com'>Sass<\/a> (&#8220;Syntactically Awesome Style Sheets&#8221;) command line product should be of interest for you.<\/p>\n<p>Let&#8217;s list in broad brush terms what Sass is capable of as far as CSS styling goes, and which we show you a stream of consciousness view of with today&#8217;s <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/Mac\/sass_scss.pdf\" title=\"Click picture\">PDF slideshow<\/a> presentation (showing you an install on a MacBook Pro, and showing its features, and the mock up of a Sass *.scss file along with its imagined &#8220;sass &#8211;watch&#8221; manipulation to change the look of a mockup webpage) &#8230;<\/p>\n<ul>\n<li>ability to preprocess, facilitating that compartmentalization thought above, command line &#8220;sass &#8211;watch&#8221; option can have a developer working on CSS stylesheet files (separately to other developers working on HTML (or server developers on PHP), separately to other developers working on Javascript) that are not the live CSS files, one step removed via &#8220;sass&#8221; looking out for changes and automatically building the live CSS files when Sass *.scss files are saved &#8230; as well as syntax and cross-browser thoughts such as &#8230;<\/li>\n<li>ability to include snippets (&#8220;partials&#8221;) or import from other Sass *.scss stylesheet files<\/li>\n<li>ability to have Sass variables<\/li>\n<li>ability to handle Sass nesting syntax<\/li>\n<li>ability to include Sass mixins to help with those cross-browser prefix (eg. &#8220;-webkit-&#8220;, &#8220;-ms-&#8220;) directive complications<\/li>\n<li>ability to share Sass (CSS) properties from one selector to another (&#8220;extend\/inherit&#8221;)<\/li>\n<li>ability to do mathematics via Sass &#8220;operators&#8221; helping convert hard-coded dimensions in pixels (px) to percentage (%) values better for responsive design principles<\/li>\n<\/ul>\n<p>We hope you try out this wonderful software tool for yourself.<\/p>\n<p>If this was interesting you may be interested in <a title='Click here to see topics in which you might be interested' href='#d46494' onclick='var dv=document.getElementById(\"d46494\"); dv.innerHTML = \"&lt;iframe width=670 height=600 src=\" + \"https:\/\/www.rjmprogramming.com.au\/ITblog\/tag\/css\" + \"&gt;&lt;\/iframe&gt;\"; dv.style.display = \"block\";'>this<\/a> too.<\/p>\n<div id='d46494' style='display: none; border-left: 2px solid green; border-top: 2px solid green;'><\/div>\n<hr>\n<p>If this was interesting you may be interested in <a title='Click here to see topics in which you might be interested' href='#d46503' onclick='var dv=document.getElementById(\"d46503\"); dv.innerHTML = \"&lt;iframe width=670 height=600 src=\" + \"https:\/\/www.rjmprogramming.com.au\/ITblog\/tag\/crontab\" + \"&gt;&lt;\/iframe&gt;\"; dv.style.display = \"block\";'>this<\/a> too.<\/p>\n<div id='d46503' style='display: none; border-left: 2px solid green; border-top: 2px solid green;'><\/div>\n","protected":false},"excerpt":{"rendered":"<p>Yesterday&#8217;s Sass CSS Stylesheet Primer Tutorial showed a really promising procedural CSS stylesheet creator tool &#8230; sass &#8211;watch [inputSassSCSS] [outputCSS] &#8230; in action, but the mode of that procedural application of that &#8230; sass &#8211;watch [inputSassSCSS] [outputCSS] # in a &hellip; <a href=\"https:\/\/www.rjmprogramming.com.au\/ITblog\/sass-css-stylesheet-background-crontab-tutorial\/\">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":[12,29,33,37],"tags":[3092,126,234,274,275,281,2457,602,2532,677,707,725,2178,3093,2621,1991,3091,1209,1211,1212,1319,1721,1719,1397,1407],"class_list":["post-46503","post","type-post","status-publish","format-standard","hentry","category-elearning","category-operating-system","category-software","category-tutorials","tag-automate","tag-background","tag-command-line","tag-crontab","tag-cross-browser","tag-css","tag-editing","tag-import","tag-include","tag-korn-shell","tag-linux","tag-mac-os-x","tag-macos","tag-mixin","tag-nesting","tag-responsive-design","tag-sass","tag-style","tag-stylesheet","tag-styling","tag-tutorial","tag-variable","tag-watch","tag-watchdog","tag-web-design"],"_links":{"self":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts\/46503"}],"collection":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/comments?post=46503"}],"version-history":[{"count":3,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts\/46503\/revisions"}],"predecessor-version":[{"id":46506,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts\/46503\/revisions\/46506"}],"wp:attachment":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/media?parent=46503"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/categories?post=46503"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/tags?post=46503"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}