{"id":65724,"date":"2021-07-12T04:10:05","date_gmt":"2021-07-12T08:10:05","guid":{"rendered":"http:\/\/bangla.salearningschool.com\/recent-posts\/korn-shell-example-show-dates-linux-unix-shell-programming-001\/"},"modified":"2021-07-12T04:10:05","modified_gmt":"2021-07-12T08:10:05","slug":"korn-shell-example-show-dates-linux-unix-shell-programming-001","status":"publish","type":"post","link":"http:\/\/bangla.sitestree.com\/?p=65724","title":{"rendered":"Korn Shell Example: Show Dates #Linux\/Unix: Shell Programming &#8211; 001"},"content":{"rendered":"<blockquote><p>bash-3.2$ cat echoscript2.ksh<br \/>\n#!\/bin\/ksh<br \/>\n#clear<br \/>\nprint &#8220;SCRIPT BEGINS&#8221;<br \/>\nprint &#8220;Hello $LOGNAME&#8221;<br \/>\nprint<br \/>\nprint -n &#8220;Todays date is: &#8221;<br \/>\ndate &#8216;+%m\/%d\/%y&#8217;<br \/>\nprint -n &#8220;and the current time is: &#8221;<br \/>\ndate &#8216;+%H:%M:%S%n&#8217;<br \/>\nprint &#8220;Now a list of the processes in the current<br \/>\nshell&#8221;<br \/>\nps<br \/>\nprint &#8220;SCRIPT FINISHED!!&#8221;<\/p>\n<p>bash-3.2$ .\/echoscript2.ksh<br \/>\nSCRIPT BEGINS<br \/>\nHello shell<\/p>\n<p>Todays date is: 04\/27\/18<br \/>\nand the current time is: 08:05:20<\/p>\n<p>Now a list of the processes in the current<br \/>\nshell<br \/>\nPID TTY TIME CMD<br \/>\n18641 syscon 0:00 ps<br \/>\n18585 syscon 0:00 sh<br \/>\n18638 syscon 0:00 echoscri<br \/>\n18589 syscon 0:00 bash<br \/>\nSCRIPT FINISHED!!<\/p><\/blockquote>\n<p> From: http:\/\/sitestree.com\/?p=12210<br \/> Categories:Linux\/Unix: Shell Programming &#8211; 001<br \/>Tags:<br \/> Post Data:2018-04-28 23:08:39<\/p>\n<p>\t\tShop Online: <a href='https:\/\/www.ShopForSoul.com\/' target='new' rel=\"noopener\">https:\/\/www.ShopForSoul.com\/<\/a><br \/>\n\t\t(Big Data, Cloud, Security, Machine Learning): Courses: <a href='http:\/\/Training.SitesTree.com' target='new' rel=\"noopener\"> http:\/\/Training.SitesTree.com<\/a><br \/>\n\t\tIn Bengali: <a href='http:\/\/Bangla.SaLearningSchool.com' target='new' rel=\"noopener\">http:\/\/Bangla.SaLearningSchool.com<\/a><br \/>\n\t\t<a href='http:\/\/SitesTree.com' target='new' rel=\"noopener\">http:\/\/SitesTree.com<\/a><br \/>\n\t\t8112223 Canada Inc.\/JustEtc: <a href='http:\/\/JustEtc.net' target='new' rel=\"noopener\">http:\/\/JustEtc.net (Software\/Web\/Mobile\/Big-Data\/Machine Learning) <\/a><br \/>\n\t\tShop Online: <a href='https:\/\/www.ShopForSoul.com'> https:\/\/www.ShopForSoul.com\/<\/a><br \/>\n\t\tMedium: <a href='https:\/\/medium.com\/@SayedAhmedCanada' target='new' rel=\"noopener\"> https:\/\/medium.com\/@SayedAhmedCanada <\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>bash-3.2$ cat echoscript2.ksh #!\/bin\/ksh #clear print &#8220;SCRIPT BEGINS&#8221; print &#8220;Hello $LOGNAME&#8221; print print -n &#8220;Todays date is: &#8221; date &#8216;+%m\/%d\/%y&#8217; print -n &#8220;and the current time is: &#8221; date &#8216;+%H:%M:%S%n&#8217; print &#8220;Now a list of the processes in the current shell&#8221; ps print &#8220;SCRIPT FINISHED!!&#8221; bash-3.2$ .\/echoscript2.ksh SCRIPT BEGINS Hello shell Todays date is: 04\/27\/18 &hellip; <\/p>\n<p><a class=\"more-link btn\" href=\"http:\/\/bangla.sitestree.com\/?p=65724\">Continue reading<\/a><\/p>\n","protected":false},"author":8,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[1917],"tags":[],"class_list":["post-65724","post","type-post","status-publish","format-standard","hentry","category-fromsitestree-com","item-wrap"],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack-related-posts":[{"id":65722,"url":"http:\/\/bangla.sitestree.com\/?p=65722","url_meta":{"origin":65724,"position":0},"title":"Topic 1: Basic Date Displaying Shell Script #Linux\/Unix: Shell Programming &#8211; 001","author":"Author-Check- Article-or-Video","date":"July 12, 2021","format":false,"excerpt":"bash-3.2$ cat echoscript1.sh #!\/bin\/sh #clear echo \"SCRIPT BEGINS\" echo \"Hello $LOGNAME\" echo echo \"Todays date is: c\" date '+%m\/%d\/%y' echo \"and the current time is: c\" date '+%H:%M:%S%n' echo \"Now a list of the processes in the current shell\" ps echo \"SCRIPT FINISHED!!\" bash-3.2$ .\/echoscript1.sh SCRIPT BEGINS Hello shell Todays\u2026","rel":"","context":"In &quot;FromSitesTree.com&quot;","block_context":{"text":"FromSitesTree.com","link":"http:\/\/bangla.sitestree.com\/?cat=1917"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":65685,"url":"http:\/\/bangla.sitestree.com\/?p=65685","url_meta":{"origin":65724,"position":1},"title":"A Basic Shell Program #Linux\/Unix: Shell Programming &#8211; 001","author":"Author-Check- Article-or-Video","date":"July 11, 2021","format":false,"excerpt":"#!\/bin\/sh #if enabled - will spit out the script to the screen #set -v #clear the screen clear echo \"SCRIPT BEGINS\" #shows current login name echo \"Hello $LOGNAME\" #shows current date in the same line echo \"Todays date is: c\" date +%m\/%d\/%y #shows current time in the same line echo\u2026","rel":"","context":"In &quot;FromSitesTree.com&quot;","block_context":{"text":"FromSitesTree.com","link":"http:\/\/bangla.sitestree.com\/?cat=1917"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":65742,"url":"http:\/\/bangla.sitestree.com\/?p=65742","url_meta":{"origin":65724,"position":2},"title":"Topic 3: Example: Current Info : Variables #Linux\/Unix: Shell Programming &#8211; 001","author":"Author-Check- Article-or-Video","date":"July 13, 2021","format":false,"excerpt":"bash-3.2$ cat currentinfo.ksh #!\/bin\/ksh # outputs the day, time, & current month. day=$(date +%D) time=$(date +%T) print \"Today is $day.\" print print \"The time is $time.\" print print \"This month's calendar:\" bash-3.2$ .\/currentinfo.ksh Today is 04\/27\/18. The time is 10:25:45. This month's calendar: From: http:\/\/sitestree.com\/?p=12227 Categories:Linux\/Unix: Shell Programming - 001Tags:\u2026","rel":"","context":"In &quot;FromSitesTree.com&quot;","block_context":{"text":"FromSitesTree.com","link":"http:\/\/bangla.sitestree.com\/?cat=1917"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":65693,"url":"http:\/\/bangla.sitestree.com\/?p=65693","url_meta":{"origin":65724,"position":3},"title":"Example use of case in KSH. Show Today&#8217;s Day Name #Linux\/Unix: Shell Programming &#8211; 001","author":"Author-Check- Article-or-Video","date":"July 11, 2021","format":false,"excerpt":"bash-3.2$ cat ksh_case_example_1.sh #!\/bin\/ksh #show today's day name DAY=`date +%a` #show value of $DAY echo $DAY #based on the value of the DAY variable show the day name in full format case \"$DAY\" in Mon) echo \"Monday\" ;; Tue) echo \"Tuesday\" ;; Wed) echo \"Wednesday\" ;; Thu) echo \"Thursday\" ;;\u2026","rel":"","context":"In &quot;FromSitesTree.com&quot;","block_context":{"text":"FromSitesTree.com","link":"http:\/\/bangla.sitestree.com\/?cat=1917"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":65750,"url":"http:\/\/bangla.sitestree.com\/?p=65750","url_meta":{"origin":65724,"position":4},"title":"Topic 3: Example : Misc Operator Examples #Linux\/Unix: Shell Programming &#8211; 001","author":"Author-Check- Article-or-Video","date":"July 13, 2021","format":false,"excerpt":"bash-3.2$ cat math.ksh #!\/bin\/ksh # Script name: math.ksh # This script finds the cube of a number, and the # quotient and remainder of the number divided by 4. y=99 (( cube = y * y * y )) (( quotient = y \/ 4 )) (( rmdr = y\u2026","rel":"","context":"In &quot;FromSitesTree.com&quot;","block_context":{"text":"FromSitesTree.com","link":"http:\/\/bangla.sitestree.com\/?cat=1917"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":65728,"url":"http:\/\/bangla.sitestree.com\/?p=65728","url_meta":{"origin":65724,"position":5},"title":"Topic 2: Example: Comments in Shell Scripts #Linux\/Unix: Shell Programming &#8211; 001","author":"Author-Check- Article-or-Video","date":"July 12, 2021","format":false,"excerpt":"bash-3.2$ cat scriptwithcomments.sh #!\/bin\/sh # This script clears the window, greets the user, # and displays the current date and time. #clear # Clear the window echo \"SCRIPT BEGINS\" echo \"Hello $LOGNAME!\" # Greet the user echo echo \"Todays date and time: c\" date # Display current date and time\u2026","rel":"","context":"In &quot;FromSitesTree.com&quot;","block_context":{"text":"FromSitesTree.com","link":"http:\/\/bangla.sitestree.com\/?cat=1917"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]}],"_links":{"self":[{"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=\/wp\/v2\/posts\/65724","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=\/wp\/v2\/users\/8"}],"replies":[{"embeddable":true,"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=65724"}],"version-history":[{"count":0,"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=\/wp\/v2\/posts\/65724\/revisions"}],"wp:attachment":[{"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=65724"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=65724"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=65724"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}