{"id":65742,"date":"2021-07-13T04:10:03","date_gmt":"2021-07-13T08:10:03","guid":{"rendered":"http:\/\/bangla.salearningschool.com\/recent-posts\/topic-3-example-current-info-variables-linux-unix-shell-programming-001\/"},"modified":"2021-07-13T04:10:03","modified_gmt":"2021-07-13T08:10:03","slug":"topic-3-example-current-info-variables-linux-unix-shell-programming-001","status":"publish","type":"post","link":"http:\/\/bangla.sitestree.com\/?p=65742","title":{"rendered":"Topic 3: Example: Current Info : Variables #Linux\/Unix: Shell Programming &#8211; 001"},"content":{"rendered":"<p>bash-3.2$ cat currentinfo.ksh<br \/>\n#!\/bin\/ksh<\/p>\n<p># outputs the day, time, &amp; current month.<br \/>\nday=$(date +%D)<br \/>\ntime=$(date +%T)<br \/>\nprint &#8220;Today is $day.&#8221;<br \/>\nprint<br \/>\nprint &#8220;The time is $time.&#8221;<br \/>\nprint<br \/>\nprint &#8220;This month&#8217;s calendar:&#8221;<br \/>\nbash-3.2$ .\/currentinfo.ksh<br \/>\nToday is 04\/27\/18.<\/p>\n<p>The time is 10:25:45.<\/p>\n<p>This month&#8217;s calendar: From: http:\/\/sitestree.com\/?p=12227<br \/> Categories:Linux\/Unix: Shell Programming &#8211; 001<br \/>Tags:<br \/> Post Data:2018-05-05 14:28:58<\/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 currentinfo.ksh #!\/bin\/ksh # outputs the day, time, &amp; current month. day=$(date +%D) time=$(date +%T) print &#8220;Today is $day.&#8221; print print &#8220;The time is $time.&#8221; print print &#8220;This month&#8217;s calendar:&#8221; bash-3.2$ .\/currentinfo.ksh Today is 04\/27\/18. The time is 10:25:45. This month&#8217;s calendar: From: http:\/\/sitestree.com\/?p=12227 Categories:Linux\/Unix: Shell Programming &#8211; 001Tags: Post Data:2018-05-05 14:28:58 Shop Online: &hellip; <\/p>\n<p><a class=\"more-link btn\" href=\"http:\/\/bangla.sitestree.com\/?p=65742\">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-65742","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":65724,"url":"http:\/\/bangla.sitestree.com\/?p=65724","url_meta":{"origin":65742,"position":0},"title":"Korn Shell Example: Show Dates #Linux\/Unix: Shell Programming &#8211; 001","author":"Author-Check- Article-or-Video","date":"July 12, 2021","format":false,"excerpt":"bash-3.2$ cat echoscript2.ksh #!\/bin\/ksh #clear print \"SCRIPT BEGINS\" print \"Hello $LOGNAME\" print print -n \"Todays date is: \" date '+%m\/%d\/%y' print -n \"and the current time is: \" date '+%H:%M:%S%n' print \"Now a list of the processes in the current shell\" ps print \"SCRIPT FINISHED!!\" bash-3.2$ .\/echoscript2.ksh SCRIPT BEGINS Hello\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":65742,"position":1},"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":65695,"url":"http:\/\/bangla.sitestree.com\/?p=65695","url_meta":{"origin":65742,"position":2},"title":"Use of For Loops and Functions in Shell Programming #Linux\/Unix: Shell Programming &#8211; 001","author":"Author-Check- Article-or-Video","date":"July 11, 2021","format":false,"excerpt":"bash-3.2$ cat multiplication.sh #!\/bin\/bash # Example use of function\/method declaration in Shell Programming # Example use of for loop #a function that will multiply 1 to 10 with 5 multiplication() { x=5 for i in {1..10} do echo $i echo \"the multiplication result is:\" $(($i*$x)) done } echo \"Print 1\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":65722,"url":"http:\/\/bangla.sitestree.com\/?p=65722","url_meta":{"origin":65742,"position":3},"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":65687,"url":"http:\/\/bangla.sitestree.com\/?p=65687","url_meta":{"origin":65742,"position":4},"title":"Examples of using variables in a Shell Program #Linux\/Unix: Shell Programming &#8211; 001","author":"Author-Check- Article-or-Video","date":"July 11, 2021","format":false,"excerpt":"#!\/bin\/sh #assign value to a variable and print to the screen NAME=\"Justetc\" echo $NAME #Ask the user to enter a Name echo ################################## echo \"enter name\" #read command is used to take input from the user read X #print the value two times to the screen echo $X echo $X\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":65742,"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\/65742","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=65742"}],"version-history":[{"count":0,"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=\/wp\/v2\/posts\/65742\/revisions"}],"wp:attachment":[{"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=65742"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=65742"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=65742"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}