{"id":65750,"date":"2021-07-13T04:10:05","date_gmt":"2021-07-13T08:10:05","guid":{"rendered":"http:\/\/bangla.salearningschool.com\/recent-posts\/topic-3-example-misc-operator-examples-linux-unix-shell-programming-001\/"},"modified":"2021-07-13T04:10:05","modified_gmt":"2021-07-13T08:10:05","slug":"topic-3-example-misc-operator-examples-linux-unix-shell-programming-001","status":"publish","type":"post","link":"http:\/\/bangla.sitestree.com\/?p=65750","title":{"rendered":"Topic 3: Example : Misc Operator Examples #Linux\/Unix: Shell Programming &#8211; 001"},"content":{"rendered":"<blockquote><p>bash-3.2$ cat math.ksh<br \/>\n#!\/bin\/ksh<br \/>\n# Script name: math.ksh<br \/>\n# This script finds the cube of a number, and the<br \/>\n# quotient and remainder of the number divided by 4.<br \/>\ny=99<br \/>\n(( cube = y * y * y ))<br \/>\n(( quotient = y \/ 4 ))<br \/>\n(( rmdr = y % 4 ))<br \/>\nprint &#8220;The cube of $y is $cube.&#8221;<br \/>\nprint &#8220;The quotient of $y divided by 4 is $quotient.&#8221;<br \/>\nprint &#8220;The remainder of $y divided by 4 is $rmdr.&#8221;<br \/>\n# Notice the use of parenthesis to<br \/>\n# control the order of evaluating.<br \/>\n(( z = 2 * (quotient * 4 + rmdr) ))<br \/>\nprint &#8220;Two times $y is $z.&#8221;<\/p>\n<p>&nbsp;<\/p>\n<p>&#8212;&#8212;<br \/>\nbash-3.2$ .\/math.ksh<br \/>\nThe cube of 99 is 970299.<br \/>\nThe quotient of 99 divided by 4 is 24.<br \/>\nThe remainder of 99 divided by 4 is 3.<br \/>\nTwo times 99 is 198.<\/p><\/blockquote>\n<p> From: http:\/\/sitestree.com\/?p=12236<br \/> Categories:Linux\/Unix: Shell Programming &#8211; 001<br \/>Tags:<br \/> Post Data:2018-05-08 23:37:30<\/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 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 % 4 )) print &#8220;The &hellip; <\/p>\n<p><a class=\"more-link btn\" href=\"http:\/\/bangla.sitestree.com\/?p=65750\">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-65750","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":65750,"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":65742,"url":"http:\/\/bangla.sitestree.com\/?p=65742","url_meta":{"origin":65750,"position":1},"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":65695,"url":"http:\/\/bangla.sitestree.com\/?p=65695","url_meta":{"origin":65750,"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":65750,"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":65748,"url":"http:\/\/bangla.sitestree.com\/?p=65748","url_meta":{"origin":65750,"position":4},"title":"Topic 3: Example : Operator #Linux\/Unix: Shell Programming &#8211; 001","author":"Author-Check- Article-or-Video","date":"July 13, 2021","format":false,"excerpt":"bash-3.2$ cat operator6.sh #!\/bin\/ksh x=15.38 y=15.72 ((z = x + y)) echo $z \u00a0 bash-3.2$ .\/operator6.sh 30 From: http:\/\/sitestree.com\/?p=12234 Categories:Linux\/Unix: Shell Programming - 001Tags: Post Data:2018-05-08 15:32:42 Shop Online: https:\/\/www.ShopForSoul.com\/ (Big Data, Cloud, Security, Machine Learning): Courses: http:\/\/Training.SitesTree.com In Bengali: http:\/\/Bangla.SaLearningSchool.com http:\/\/SitesTree.com 8112223 Canada Inc.\/JustEtc: http:\/\/JustEtc.net (Software\/Web\/Mobile\/Big-Data\/Machine Learning) Shop Online:\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":65726,"url":"http:\/\/bangla.sitestree.com\/?p=65726","url_meta":{"origin":65750,"position":5},"title":"Topic 2: Logname, Date Time, 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 firstscript.sh #!\/bin\/sh #clear echo \"SCRIPT BEGINS\" echo \"Hello $LOGNAME!\" echo echo \"Today's date and time: c\" date echo mynum=21 myday=\"Monday\" echo \"The value of mynum is $mynum\" echo \"The value of myday is $myday\" echo echo \"SCRIPT FINISHED!!\" echo bash-3.2$ .\/firstscript.sh SCRIPT BEGINS Hello shell! Today's date and\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\/65750","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=65750"}],"version-history":[{"count":0,"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=\/wp\/v2\/posts\/65750\/revisions"}],"wp:attachment":[{"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=65750"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=65750"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=65750"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}