{"id":14175,"date":"2018-04-16T21:12:26","date_gmt":"2018-04-17T01:12:26","guid":{"rendered":"http:\/\/bangla.salearningschool.com\/recent-posts\/?p=14175"},"modified":"2018-04-16T21:12:26","modified_gmt":"2018-04-17T01:12:26","slug":"if-then-%e0%a6%8f%e0%a6%b0-%e0%a6%ac%e0%a7%8d%e0%a6%af%e0%a6%ac%e0%a6%b9%e0%a6%be%e0%a6%b0-%e0%a6%b6%e0%a7%87%e0%a6%b2-%e0%a6%aa%e0%a7%8d%e0%a6%b0%e0%a7%8b%e0%a6%97%e0%a7%8d%e0%a6%b0%e0%a6%be","status":"publish","type":"post","link":"http:\/\/bangla.sitestree.com\/?p=14175","title":{"rendered":"if-then \u098f\u09b0 \u09ac\u09cd\u09af\u09ac\u09b9\u09be\u09b0 &#8211; \u09b6\u09c7\u09b2 \u09aa\u09cd\u09b0\u09cb\u0997\u09cd\u09b0\u09be\u09ae\u09bf\u0982-\u098f"},"content":{"rendered":"<p>#!\/bin\/sh<\/p>\n<p>#count the number of files in current directory, and check if the number is equal to or greater than or less than 26<\/p>\n<p>#NOF represents number of files<\/p>\n<p>NOF=`ls -l | wc -l`<\/p>\n<p>if [ $NOF -eq 26 ]<br \/>\nthen<br \/>\necho &#8220;No of files and directories is equal to 26&#8221;<br \/>\nfi<\/p>\n<p>if [ $NOF -gt 26 ]<br \/>\nthen<br \/>\necho &#8220;No of files is greater than 26&#8221;<br \/>\nfi<\/p>\n<p>if [ $NOF -lt 26 ]<br \/>\nthen<br \/>\necho &#8220;No of files is less than 26&#8221;<br \/>\nfi<\/p>\n<p>exit<\/p>\n","protected":false},"excerpt":{"rendered":"<p>#!\/bin\/sh #count the number of files in current directory, and check if the number is equal to or greater than or less than 26 #NOF represents number of files NOF=`ls -l | wc -l` if [ $NOF -eq 26 ] then echo &#8220;No of files and directories is equal to 26&#8221; fi if [ $NOF &hellip; <\/p>\n<p><a class=\"more-link btn\" href=\"http:\/\/bangla.sitestree.com\/?p=14175\">Continue reading<\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[1888],"tags":[],"class_list":["post-14175","post","type-post","status-publish","format-standard","hentry","category---shell-programming","item-wrap"],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack-related-posts":[{"id":14169,"url":"http:\/\/bangla.sitestree.com\/?p=14169","url_meta":{"origin":14175,"position":0},"title":"\u09b6\u09c7\u09b2 \u09aa\u09cd\u09b0\u09cb\u0997\u09cd\u09b0\u09be\u09ae\u09bf\u0982 \u098f if-then-else \u098f\u09b0 \u0989\u09a6\u09be\u09b9\u09b0\u09a3","author":"Sayed","date":"April 16, 2018","format":false,"excerpt":"#!\/bin\/sh #If then else example #if elif else NOF=5 if [ $NOF -eq 27 ] then echo \"No of files and directories = 27\" elif [ $NOF -gt 27 ] then echo \"No of files are dir are greator than 27\" else echo \"No of files and directories are less\u2026","rel":"","context":"In &quot;\u09b6\u09c7\u09b2 \u09aa\u09cd\u09b0\u09cb\u0997\u09cd\u09b0\u09be\u09ae\u09bf\u0982 - Shell Programming&quot;","block_context":{"text":"\u09b6\u09c7\u09b2 \u09aa\u09cd\u09b0\u09cb\u0997\u09cd\u09b0\u09be\u09ae\u09bf\u0982 - Shell Programming","link":"http:\/\/bangla.sitestree.com\/?cat=1888"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":65714,"url":"http:\/\/bangla.sitestree.com\/?p=65714","url_meta":{"origin":14175,"position":1},"title":"If then else in shell programming. Count the number of files in current directory, and check &#8230; #Linux\/Unix: Shell Programming &#8211; 001","author":"Author-Check- Article-or-Video","date":"July 12, 2021","format":false,"excerpt":"#!\/bin\/sh #count the number of files in current directory, and check if the number is equal to or greater than or less than 26 #NOF represents number of files NOF=`ls -l | wc -l` if [ $NOF -eq 26 ] then echo \"No of files and directories is equal to\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":65720,"url":"http:\/\/bangla.sitestree.com\/?p=65720","url_meta":{"origin":14175,"position":2},"title":"If then else example in Shell Programming #Linux\/Unix: Shell Programming &#8211; 001","author":"Author-Check- Article-or-Video","date":"July 12, 2021","format":false,"excerpt":"#!\/bin\/sh #If then else example #if elif else NOF=5 if [ $NOF -eq 27 ] then echo \"No of files and directories = 27\" elif [ $NOF -gt 27 ] then echo \"No of files are dir are greator than 27\" else echo \"No of files and directories are less\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":14171,"url":"http:\/\/bangla.sitestree.com\/?p=14171","url_meta":{"origin":14175,"position":3},"title":"\u09ac\u09c3\u09b9\u09b8\u09cd\u09aa\u09a4\u09bf\u09ac\u09be\u09b0 \u098f\u09ac\u0982 \u09b6\u09c1\u0995\u09cd\u09b0\u09ac\u09be\u09b0\u09c7 \/ etc \u09ab\u09cb\u09b2\u09cd\u09a1\u09be\u09b0\u09c7 \u09b8\u09ae\u09b8\u09cd\u09a4 \u09ac\u09bf\u09b7\u09af\u09bc\u09ac\u09b8\u09cd\u09a4\u09c1 \/export\/home\/shell\/test\/etc.tar \u09a4\u09c7  tar \u09b9\u09bf\u09b8\u09be\u09ac\u09c7 backup \u0995\u09b0\u09c1\u09a8","author":"Sayed","date":"April 16, 2018","format":false,"excerpt":"#!\/bin\/ksh # on every thursday and friday tar all contents of \/etc folder into \/export\/home\/shell\/test\/. On thursday only create a log file with the list of files #in the tar file. On thursday untar \/export\/home\/shell\/test\/etc.tar into vfstab . Then log vfstab exist or not information DAY=`date +%a` DATESTAMP=`date +%m-%d-%Y-%H:%M` if\u2026","rel":"","context":"In &quot;\u09b6\u09c7\u09b2 \u09aa\u09cd\u09b0\u09cb\u0997\u09cd\u09b0\u09be\u09ae\u09bf\u0982 - Shell Programming&quot;","block_context":{"text":"\u09b6\u09c7\u09b2 \u09aa\u09cd\u09b0\u09cb\u0997\u09cd\u09b0\u09be\u09ae\u09bf\u0982 - Shell Programming","link":"http:\/\/bangla.sitestree.com\/?cat=1888"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":14148,"url":"http:\/\/bangla.sitestree.com\/?p=14148","url_meta":{"origin":14175,"position":4},"title":"\u09b6\u09c7\u09b2 &#8211; case \u098f\u09b0 \u09ac\u09cd\u09af\u09ac\u09b9\u09be\u09b0 ksh &#8211; \u098f\u0964 Example use of Case in KSH. Show Today&#8217;s Day Name","author":"Sayed","date":"April 15, 2018","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;\u09b6\u09c7\u09b2 \u09aa\u09cd\u09b0\u09cb\u0997\u09cd\u09b0\u09be\u09ae\u09bf\u0982 - Shell Programming&quot;","block_context":{"text":"\u09b6\u09c7\u09b2 \u09aa\u09cd\u09b0\u09cb\u0997\u09cd\u09b0\u09be\u09ae\u09bf\u0982 - Shell Programming","link":"http:\/\/bangla.sitestree.com\/?cat=1888"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":14152,"url":"http:\/\/bangla.sitestree.com\/?p=14152","url_meta":{"origin":14175,"position":5},"title":"\u09b6\u09c7\u09b2 \u09aa\u09cd\u09b0\u09cb\u0997\u09cd\u09b0\u09be\u09ae\u09bf\u0982 \u098f for \u09b2\u09c1\u09aa \u098f\u09ac\u0982 \u09ab\u09be\u0982\u09b6\u09a8 \u098f\u09b0 \u09ac\u09cd\u09af\u09ac\u09b9\u09be\u09b0\u0964 Use of For Loop and Function in Shell Programming","author":"Sayed","date":"April 15, 2018","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;\u09b6\u09c7\u09b2 \u09aa\u09cd\u09b0\u09cb\u0997\u09cd\u09b0\u09be\u09ae\u09bf\u0982 - Shell Programming&quot;","block_context":{"text":"\u09b6\u09c7\u09b2 \u09aa\u09cd\u09b0\u09cb\u0997\u09cd\u09b0\u09be\u09ae\u09bf\u0982 - Shell Programming","link":"http:\/\/bangla.sitestree.com\/?cat=1888"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]}],"_links":{"self":[{"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=\/wp\/v2\/posts\/14175","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\/2"}],"replies":[{"embeddable":true,"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=14175"}],"version-history":[{"count":1,"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=\/wp\/v2\/posts\/14175\/revisions"}],"predecessor-version":[{"id":14176,"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=\/wp\/v2\/posts\/14175\/revisions\/14176"}],"wp:attachment":[{"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=14175"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=14175"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=14175"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}