BASH/C2/Nested-and-multilevel-if-elsif-statements/Khasi

From Script | Spoken-Tutorial
Revision as of 16:08, 3 June 2017 by Meboreen Mary (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
Time Narration
00:00 Paralok baieid, ngi pdiangsngewbha ia phi sha ka spoken tutorial halor ka Nested and multilevel if statement ha BASH.
00:09 Ha kane ka jinghikai, ngin pule shaphang:
00:12 Nested if-else bad
00:14 Multilevel if-else statement.
00:17 Ngin leh ia kane da ka jingiarap ki katto katne tylli ki nuksa.
00:22 Ban bud ia kane ka jinghikai, phi dei ban tip bad nang ia ka Linux Operating System.
00:28 Lada phim pat tip, te na ka bynta ki jinghikai ba iadei peit ia ka website jong ngi ba la pyni hangne
00:35 Na ka bynta kane ka jinghikai, nga pyndonkam: Ubuntu Linux 12.04 OS bad
00:38 Ubuntu Linux 12.04 OS
00:42 GNU Bash version 4.1.10
00:46 ka GNU Bash version 4 lane kiba kham shajrong la ai jingmut na ka bynta ka jinghikai.
00:52 To ngin peit ban sngewthuh ia ka jingiaid jong ka Nested if-else statement.
00:57 Hangne, lada ka condition 1 kadeiTrue te kacondition 2 kan sa shah evaluate.
01:04 Lada ka condition2 kadei True te ka statement 1' kan sa shah evaluate.
01:10 Kata kamut, tang lada baroh artylli ki conditions 1 bad 2 kidei True te ka statement 1' kan sa execute.
01:19 Lada ka condition1 kadei False, te ka statement 3 kan sa execute.
01:25 Bad lada ka condition 2' kadeiFalse te ka statement 2 kan sa execute.
01:31 To ngin peit kawei ka nuksa.
01:33 Nga la thoh ia u code ha ka file nestedifelse.sh.
01:38 Ngan plié ia ka.
01:40 To ngan batai ia u code mynta.
01:43 Kane kadei ka shebang line.
01:45 u variable NAME la assign u value anusha.
01:50 U variable PASSWORD la assign u value "abc123".
01:56 Ka read command ka read ia uwei u line jong ka data na ka standard input.
02:02 '- (hyphen) p' flag ka pyni ia u prompt.
02:05 U string hadien - (hyphen) p, “Enter name: ” yn pyni ha ka terminal.
02:11 myname udei u variable ba buh ia ka text ba la pyndap da u user kata ka user input.
02:18 Ka if statement kaba nyngkong ka nujor ia ki artylli ki variables myname badNAME
02:24 Kata ka user input bad u value ba la buh ha u variable Name kata "anusha".
02:31 Lada baroh artylli ki values ki iahap te ka code kaba bud ha kane ka if statement yn sa evaluate.
02:38 Ka read command ka read bad buh ia u password ba la pyndap ha u variable mypassword.
02:46 Hangne, '- (hyphen) s' flag kadei na ka bynta ka silent mode.
02:49 Ka mut ba ka text ba la pyndap da u user kan ym paw ha ka terminal.
02:56 Hangne, ngi don sa kawei ka set jong ka if-else statements.
02:59 Kane ka set jong ka if-else statements ka don hapoh jong ka if kaba nyngkong.
03:05 Ka if statement kaba ar ka nujor ia ki variables mypassword bad PASSWORD.
03:12 echo ka pyni ia ka message “Welcome” ha ka terminal lada kaif condition kadei True
03:18 Kata kamut ki passwords ki iahap.
03:21 '-e' u enable ia ka jingtreikam jong u backslash escape.
03:27 '\n' u ieng na bynta u new line kaba mut ba u string Welcome” yn sa print ha ka lain bathymmai.
03:35 Lada ka if condition kam dei True te ka else condition kan execute.
03:42 Kata kamut lada ki passwords kim iahap, ka else condition kan sa execute.
03:48 Ha kane ka bynta, ka echo ka pyni “Wrong password”.
03:53 fi u pynkut ia ka if-else statement ba hapoh.
03:57 Phai biang sha ka if-else statement-
04:01 Lada ki values ha myname bad NAME kim iahap te ka else statement kan sa execute.
04:09 Kane kan echo ia ka message “Wrong Name” ha katerminal.
04:14 fi u pynkut ia ka if-else statement ba shabar.
04:18 Mynta , plié ia ka terminal window da kaba nion ctrl+alt bad t keys ha kajuh ka por na keyboard.
04:27 Pynlong ia ka file executable.
04:29 Type: chmod space plus x space nestedifelse.sh
04:38 Type: dot slash nestedifelse.sh
04:43 Ka program ka pynshisha ia ki artylli ki conditions
04:46 Kita kidei Name badPassword
04:48 Haba la execute ha ka terminal.
04:52 Hangne, u prompt u pyni Enter Name:
04:55 To ngin type "anusha".
04:57 Namar ba kane ka condition kadei True, te ia ka if condition kaba bud yn sa evaluate
05:02 Mynta u prompt u ongPassword.
05:05 Ngan type iaka password kum "abc123".
05:10 Ka password ka iahap bad u value ba don ha u variable PASSWORD.
05:15 Te, u prompt u pyni ia ka message Welcome.
05:19 Mynta to ngin execute ia ka script sa shisien.
05:21 Nion ia u 'up-arrow' key.
05:24 Leit sha ka dot slash nestedifelse.sh
05:29 Nion Enter.
05:31 Mynta ngin pyndap biang ia kajuh ka kyrteng bad u password ba iapher
05:37 Te, nga pyndap ia ka kyrteng kum "anusha" bad password kum "123".
05:44 U value name un iahap tangba u value password un ym iahap
05:49 Te , ka message Wrong passwordkan sa paw.
05:53 Kane ka pynshisha ba ka nested else statement hapoh jong ka if statement banyngkong ka la execute.
06:01 To ngin execute ia ka script sa shisien
06:04 Ha kane ka kynti, ngin pyndap ia ka kyrteng kum "swati".
06:08 Ka message “Wrong name” ka paw.
06:12 Kane kadei namar ka kyrteng "swati" kam iahap bad u value ba declare hashwa kata "anusha".
06:19 U control u mih noh na ka if statement banyngkong bad execute ia ka else statement.
06:25 Kane kan print ia ka message Wrong name.
06:29 Mynta to ngin peit ia ka multilevel if-else statement.
06:34 Lada ka condition1 kadei True te ka statement1 ka execute.
06:40 Lada ka condition1 kadei False te ka condition 2 kan sa shah evaluate.
06:46 Lada ka condition2 kadei True te ka statement 2 ka execute .
06:52 Bad lada ka condition 2 kadei False te ka condition N ka shah evaluate.
06:58 Lada ka condition N kadei True te ka statement N ka execute.
07:03 Bad lada ka Condition N kadei falsete ka statement X kan sa execute.
07:10 To ngin peit ia kawei ka nuksa.
07:12 Nga don kawei ka nuksa ba la treikam lypa
07:14 Ngan plié ia ka. Kynmaw ba ka file name kadei multilevel hyphen ifelse dot sh.
07:23 To ngin peit ia u code.
07:25 Kane kadei ka shebang line.
07:27 mystring udei u variable uba buh ia ka word, ba la ai da u user, ha kapor execution.
07:34 Ka if condition ka check lada ka input string kadei null.
07:39 '- (hyphen) z' ka check lada ka jingjrong jong u string kadei zero.
07:44 Type: man test ha ka terminal bad peit ia shibun ki string comparison.
07:51 Ka echo statement kan sa print lada khlem pat pyndap eiei.
07:56 Ka elif condition kaba nyngkong ka check lada ka input string kadon "raj".
08:03 Lada ka don te kane ka echo statement kan sa print.
08:08 U wildcard character u peit ba kano kano ka kyntien kaba don"raj" ha ka, yn sa ithuh.
08:15 Ka elif condition kaba bud ka check lada ka input string kadon ia ka kyntien "jit".
08:22 Lada ka don te kane ka echo statement kan sa print.
08:27 Ka else condition kan sa execute lada baroh ki conditions ba hajrong ki fail.
08:33 Bad kan sa pyni ia ka message Sorry! Input does not contain either 'raj' or 'jit'.
08:41 fi ka pyni ia ka jingkut jong ka multilevel if-else statement.
08:46 To ngin execute ia kane ka program
08:48 Phai biang sha ka terminal jong ngi.
08:51 Type: chmod space plus x space multilevel hyphen ifelse dot sh
09:00 Type dot slash multilevel hyphen ifelse dot sh
09:06 Ia ngi la prompt na ka bynta ka input
09:09 To ngin ai ki input bapher bapher bad peit ka jia aiu man ka por.
09:14 Nyngkong ngan nion Enter khlem da type eiei.
09:19 Ka message Nothing was Entered ka paw.
09:22 Bad u control u mih noh na ka multilevel if-else statement.
09:28 To ngan clear ia ka prompt.
09:30 To ngin pyrshang ban execute ia ka script da kawei ka input.
09:34 Nion ia u 'up-arrow' key.
09:36 Leit sha ka dot slash multilevel hyphen ifelse dot sh.
09:41 Nion Enter.
09:43 U prompt u pyni "Enter a Word".
09:45 Ngan type "abhijit".
09:48 Ka output ba pyni kadei :“abhijit" contains word 'jit'.
09:53 Kane ka pyni ba u control u iaid sha ka condition balai ha ka code jong ngi.
09:59 Ki artylli ki conditions ki khlem iahap
10:03 Kajuh ka logic ka treikam ha baroh ki conditions.
10:07 Pyrshang ban execute ia ka program da ki inputs bapher bapher bad check ia ki results
10:13 To ngin batai kyllum.
10:15 Ha kane ka jinghikai, ngi la pule shaphang ka jingdonkam jong ka:
10:18 Nested if-else: ryngkat ka Name bad Password verification bad
10:23 Multilevel if-else: String comparison program.
10:28 Kum ka kam na ka bynta jong phi, thoh ia ka program ban output ia ki message bapher bapher haba u nombar udei
10:34 Kham heh ban ia u 3 kham rit ban ia u 3
10:37 Lane iaryngkat bad u 3
10:39 Lane haba ka user input kam don eiei lane thylli
10:42 Peit ia ka video ba don ha ka link ba la ai harum
10:45 Ka batai kyllum ia ka Spoken-Tutorial project.
10:48 Lada phim don ia ka bandwidth kaba biang , phi lah ban shu download bad peit ia ka .
10:53 Ka kynhun jong ka Spoken-Tutorial Project:
10:55 Ka pynlong ia ki workshops da kaba pyndonkam da ki spoken tutorials
10:58 Ka ai sertiphikate sha kito kiba pass ha ka online test.
11:02 Na ka bynta ki jingtip ba bniah, sngewbha thoh sha ka contact@spoken-tutorial.org
11:09 Spoken Tutorial Projek kadei shibynta jong ka "Talk to a Teacher" projek.
11:13 La kyrshan ia ka da ka National Mission on Education lyngba ka ICT, MHRD, Sorkar India.
11:20 Kham bun ki jingtip halor kane ka mission kidon ha ka link ba la ai harum http://spoken-tutorial.org/NMEICT-Intro
11:26 Kane ka script la noh synniang da ka FOSSEE bad ka kynhun jong ka Spoken-Tutorial .
11:31 Bad nga I Meboreen na Shillong , nga pynkut ia kane. Khublei shibun ia ka jingsnohkti lang jong phi.

Contributors and Content Editors

Meboreen Mary