BASH/C2/Case-statement/Khasi

From Script | Spoken-Tutorial
Jump to: navigation, search
Time Narration
00:01 Paralok baieid, ngi pdiangsngewbha ia phi sha ka “spoken tutorial” halor ka “Case statement” ha “Bash.”
00:07 Ha kane ka jinghikai, ngin ia pule ia : ka jingdonkam jong ka “case statement”, Syntax jong ka “case statement” bad ki nuksa.
00:17 Ban bud ia kane ka jinghikai, phi dei ban don ia ka jingtip halor ka “Shell” scripting.
00:23 Lada phim don, te na ka bynta ki jingtip ba iadei bad kane, sngewbha leit sha ka website jong ngi kumba la pyni.
00:29 Na ka bynta kane ka jinghikai, nga pyndonkam: Ubuntu Linux 12.04 Operating System bad ka GNU BASH version 4.1.10
00:39 Sngewbha kynmaw, ka “GNU Bash” version 4 lane kaba kham shajrong lah ai jingmut na ka bynta kane ka jinghikai.
00:47 Ka Bash shell kadon ar jait ki conditional statements- 'if' statement bad ka 'case' statement.
00:56 Ka “Case” statement lah ban pyndonkam bujli ha ka jaka jong ka “if-else” statement.
01:03 Ka “case” statement kalong kaba la shim nyngkong ynda don bun tylli ki item kiba dei ban jied.
01:09 La kham pyndonkam ia ka ha ka ban pyntreikam ia ki “menu”s ha ka script.
01:14 To ngin ia peit ia ka syntax. case space $(dollar) VARIABLE space in match_1 close round-bracket space commands bad ar tylli ki semicolon
01:27 match_n close round-bracket space commands bad ar tylli ki semicolon asterisk close round=bracket space command_to_execute_by_default bad ar tylli ki semicolon esac.
01:45 Ia u “VARIABLE” la pynianujor bad match_1.
01:48 Lada kam iadei bad iahap, ka leit noh sha ka kawei ka case kaba dei ka match_n.
01:54 Kan check lada iwei napdeng kine ki strings ki iadei bad iahap bad u VARIABLE.
02:01 Lada 'yes' te baroh ki commands haduh ki double semicolon (;;) kin sa shah execute.
02:07 Lada kam iadei bad iahap hangne ruh bad u VARIABLE, ki command kiba don jingiadei bad u asterisk kin sa shah execute.
02:14 Kadei ka case condition kaba long hi namar u asterisk un iahap bad iadei bad baroh ki strings.
02:21 esac ka kdew ia ka jingkut jong ka case block.
02:26 To ngin pyrshang ban pynsngewthuh ia ka “case statement” bad ki nuksa.
02:32 Nga lah type lypa ia ka program. Te, ngan plie ia ka file “case.sh”.
02:38 Ka program ka print ia ka khubor kaba maham lada ka disk space ka jan kot sha ka limit ba la buh.
02:45 Kane ka dei ka “shebang line.”
02:47 Ka jaka jong ka bash ka iapher ha kiwei ki jait Linux kum ki CentOS, RedHat bad kiwei kiwei.
02:55 Ka /bin/bash kaba la pyndonkam hashwa ka kdew beit ia ka binary file.
03:01 La pyndonkam ia ka “env” hangne, kaba batai thikna ia ka jaka ba ka “bash” kadon.
03:07 Kane ka shebang line ka iarap ia ka jingsuk ban pyndonkam jong ka script ha ka GNU/Linux system.
03:16 df -(hyphen)h ka pyni ia ka disk space kaba la pyndonkam ha ka rukom ban suk ban pule ki briew.
03:22 Ka output ka lah iasnoh bad ka sort -rk5 kaba pynbeit ryntih ia ka column kaba san ha ka order kaba da dien.
03:31 Nangta ka output ka pass sha ka awk 'FNR == 2 {print $5}'
03:38 Kaba sei ia ka “field” kaba san jong ka lain kaba ar.
03:43 Da kumne, ka output ka la pass sha ka cut -(hyphen)d “% -(hyphen)f1” ban weng ia u % sign.
03:55 Kane kadei ka line ba nyngkong jong ka “case statement.”
03:59 Hangne, ngi pynianujor ia ka “space” hapdeng u 0 bad 69.
04:04 Lada ka jingiadei kadon, kan print “Everything is OK”
04:08 Hadien kane, ka ia nujor ia ka “space” hapdeng u 70 bad 89 lane na u 91 sha 98.
04:17 Lada ka jingiadei kadon, kan print “Clean out. There's a partition that is $(dollar)space % full.”
04:27 Hangne, ka ia nujor ia ka “space” bad u 99.
04:30 Lada ka jingiadei kadon, kan print “Hurry. There's a partition at $(Dollar) space %!”
04:39 Kane kadei ka “case” condition kaba long hi namar u asterisk un ia pyniadei bad baroh ki “strings”.
04:45 Bad kane kadei kaba kut jong ka “case statement.”
04:48 Mynta, leit sha ka “terminal” ban pynlong ia ka file executable.
04:52 Type: chmod plus x case dot sh
04:57 Type: dot slash case dot sh
05:02 "Everything is OK". Kynmaw ba ka output kan iapher katkum ha ka disk space jong ka system jong phi.
05:10 Ha ka machine jong nga, kumba ka lap ba kadon ka jingiadei hapdeng u 0 bad 69, kan print “Everything is OK”.
05:18 Check ia ka khubor kaba la print ha ka machine jong phi.
05:20 Phin sa lah ban sngewthuh kaei ka “case” statement kaba la shah execute.
05:27 Da kane ngi lah poi sha kaba kut jong kane ka jinghikai. To ngin ia batai kyllum.
05:31 Ha kane ka jinghikai, ngi la pule: Ka jingdonkam jong ka “case” statement, Syntax jong ka “case” statement bad ka nuksa jong ka “disc-space”.
05:41 Kum ka kam na ka bynta jong phi. Thoh ia ka menu driven program na ka bynta ka mathematical calculation-
05:47 Kadei ban shim ia ka inputs jong u nongpyndonkam ‘a’ bad ‘b’.s
05:51 Kadei ban kylli ia u mathematical opetator (plus +, minus -, division / bad multiplication *). * Leh ia ka calculation * print ia ka output.
06:02 Peit ia ka video kaba don ha ka link ba la ai harum.
06:06 Ka kyllum lang ia ka Spoken-Tutorial project.
06:08 Lada phim don ia ka bandwidth kaba biang, phi lah ban shu download bad peit ia ka hadien.
06:14 Ka kynhun jong ka Spoken Tutorial Project:
06:16 Ka pynlong ia ki workshops da kaba pyndonkam da ki spoken tutorials; ka ai certificates sha kito kiba pass ha ka online test.
06:23 Na ka bynta kham bun ki jingtip, sngewbha thoh sha ka contact@spoken-tutorial.org
06:31 “Spoken Tutorial” project kadei shi bynta jong ka “Talk to a Teacher” project.
06:35 La kyrshan ia ka da ka National Mission on Education lyngba ka ICT, MHRD, Sorkar India. Kham bun ki jingtip halor kane ka mission kidon ha ka: http://spoken-tutorial.org/NMEICT-Intro
06:48 Ia kane ka script la noh synniang da ka FOSSEE bad ka kynhun jong ka spoken-tutorial.
06:53 Ma nga i Meboreen na Shillong nga pynkut ia kane. Khublei shibun.

Contributors and Content Editors

Meboreen Mary