BASH/C2/Logical-Operators/Khasi

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

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
Time Narration
00:01 Paralok baieid, ngi pdiangsngewbha ia phi sha ka Spoken tutorial halor ka Logical Operators haBash.
00:07 Ha kane ka jinghikai, ngin pule shaphang ki jingpyndonkam jong
00:10 Logical NOTda kaba pyndonkam ia ki katto katne ki nuksa.
00:19 Ban bud ia kane ka jinghikai, phi dei ban tip bad nang ia ka Linux Operating System.
00:22 if-else statement

command line arguments bad quoting ha BASH.

00:30 Lada phim pat tip, te na ka bynta ki jinghikai ba iadei, leit sha ka website jong ngi kumba la pyni hangne
00:36 Na ka bynta kane ka jinghikai, nga pyndonkam :
00:38 Ubuntu Linux 12.04 OS
00:43 GNU Bash version 4.1.10
00:47 ka GNU Bash version 4 lane kiba kham shajrong la ai jingmut na ka bynta ka jinghikai
00:53 To ngin peit ban sngewthuh ia ka jingdonkam jong ki Logical-operators.
00:57 Logical operators bunsien la ju pyndonkam ban teh lakam ia ka jingiaid ka program.
01:02 Logical operators ki iarap ban link ia artylli ki expressions lane conditions.
01:09 Ki lah ban dei ka bynta jong if, while lane kiwei pat ki control statements.
01:15 To ngin peit ia ka syntax jong ka logical AND.
01:19 Opening square-bracket space dollar symbol condition1 space closing square-bracket space ampersand ampersand space opening square-bracket space dollar symbol condition2 space closing square-bracket.
01:38 Lane ngi lah ban pyndonkam ia kane ka syntax-
01:41 Opening square-bracket space dollar symbol condition1 space hyphen-a space dollar symbol condition2 space closing square-bracket.
01:53 Logical AND u return True haba baroh artylli condition1 bad condition2 kidei True.
02:00 To ngin iapeit ia ka syntax jong Logical OR.
02:04 Opening square-bracket space dollar symbol condition1 space closing square-bracket space vertical bar again vertical bar space opening square-bracket space dollar symbol condition2 space closing square-bracket.
02:22 Lane ngi lah ban pyndonkam ia kane ka syntax-
02:24 Opening square-bracket space dollar symbol condition1 space hyphen-o space dollar symbol condition2 space closing square-bracket.
02:36 Logical OR u return True haba kawei na ki condition1 lane condition2 kadei True.
02:43 To ngin pule ia ka jingdonkam jong ka Logical OR bad Logical AND da kaba pyndonkam ia kawei ka nuksa.
02:50 Nga la dep type lypa ia u code ha ka file ba kyrteng logical.sh.
02:55 Plie ia ka terminal da kaba nion ctrl+alt bad t keys ha kajuh ka por na ka keyboard jong phi.
03:04 Type: gedit space logical.sh space ampersand sign,nion Enter.
03:12 Mynta type ia u code kumba la pyni hangne , ha ka "logical.sh" file jong phi.
03:18 To ngan batai ia u code mynta.
03:21 Kane kadei ka shebang line.
03:25 Ka read command ka shim lane pule ia kawei ka lain jong ka data na ka standard input.
03:29 - (hyphen) p u pyni ia u prompt.
03:33 string udei u variable uba buh ia ka text ba la pyndap da u user , ha ka por ba execute.
03:39 Ka if statement ka check la u string ba la pyndap u long empty ne em
03:45 - (hyphen) z u check la ka jingjrong jong u string kadei zero.
03:50 Type: man space test ha ka terminal ban wad ia kiwei pat ki string comparisons.
03:57 Ka echo statement kan print ia ka message lada khlem pyndap eiei.
04:02 Lada u string u don eiei, ka program kan iaid sha ka elif statement ba nyngkong
04:08 Hangne, ka check la u string ba la pyndap u don baroh ar tylli ki kyntien "raj" bad "jit".
04:16 Lada haoid , te un sa echo ia kawei ka message.
04:20 Sngewbha buh jingkynmaw ba ka logical AND la pyndonkam hangne
04:24 Te kumta, ka message yn sa pyni tang lada baroh ar tylli ki conditions ki iadei.
04:31 Lada kam long kumta, te ka program kan iaid noh sha ka elif statement kaba ar
04:37 H angne, ka check la u string ba la pyndap u don kawei na kine, "raj" lane "jit".
04:43 Lada ‘yes’ te ka pyni ia ka message.
04:47 Sngewbha buh jingkynmaw ba ka logical OR la pyndonkam hangne
04:52 Ka message kan sa paw tang lada kawei na kine ki conditions ki iadei.
04:59 Khatduh eh , ngi don ia ka default else statement.
05:02 Lada baroh ki statements ba hajrong kidei False te, kane ka statement kan sa execute.
05:08 "fi" kadei kaba kut jong ka multilevel if-else loop.
05:12 To ngin execute ia ka program.
05:15 Phai biang sha ka terminal.
05:17 Nyngkong pynlong ia ka file ban execute da kaba type: chmod space plus x space logical dot sh nionEnter.
05:30 Mynta type: dot slash logical.sh nionEnter.
05:36 U prompt u pyni "Enter a word:"
05:38 Ngan pyndap "jitinraj" .
05:42 Ka output kadei: "jitinraj contains both the words 'raj' and 'jit' ".
05:48 Kane ka mut ba u control la phah sha ka statement kaba ar.
05:52 Bad namar ba baroh artylli ki conditions ki iadei, te ka pyni ia ka message.
05:57 Mynta , to ngin executeia ka script sa shisien.
06:00 Nion ia u up-arrow key.
06:02 Leit sha ./logical.sh nion Enter.
06:07 U prompt u pyni "Enter a word:"
06:09 Mynta ngan pyndap "abhijit".
06:13 Ka output ka paw kum :"abhijit contains the word 'raj' or 'jit'".
06:19 Sngewbha pyrshang ban execute ia ka program da ki input bapher bapher bad peit ia ka output.
06:25 To ngin phai biang sha ki slides jong ngi.
06:27 To ngin iapeit ia ka logical NOT operator.
06:31 Ka invert lane pynkylla ia ka Boolean value jong ka expression.
06:35 Kaba mut ka return True lada ka expression kadei False
06:40 Bad ka return False lada ka expression kadei True.
06:44 Ka syntax jong ka logical NOT operator kadei-
06:48 Exclamation mark space expression
06:52 Lane opening square-bracket space exclamation mark space expression space closing square-bracket.
07:00 To ngin peit ia kawei ka nuksa.
07:03 Nga la dep type lypa ia u code ha ka file.
07:05 Te, ngan leit sha ka terminal bad type: gedit space logicalNOT dot sh space ampersand sign, nion Enter.
07:18 Mynta type ia u code kumba la pyni hangne, ha ka logicalNOT dot sh file jong phi.
07:24 Kane kadei ka shebang line kumba ngi la tip lypa.
07:28 $1 udei u command line argument ba nyngkong ba la passed sha ka script.
07:33 - (hyphen) f u check la ka file ka don da ka juh ka kyrteng kaba la passed kum ka argument.
07:41 Te, kan return True lada ka file ka don bad False lada kam don.
07:48 Une u NOT operator, u pynkylla ia u returned value
07:52 Kaba mut, lada ka file da kata ka kyrteng ka don, ka condition kan dei True.
07:58 Tangba u NOT operator u pynkylla ia u value jong u sha False.
08:02 Bad un sa pyni ia ka message "FILE does not exist".
08:07 Hangne, ha ka else statement, ka pyni ia ka message FILE exists.
08:13 "fi" u kdew ia ka jingkut jong ka if loop.
08:16 Mynta phai biang sha ka terminal.
08:18 To ngan clear ia u prompt.
08:20 To ngin shna ia kawei ka file bathylli da ka kyrteng test.txt.
08:25 Type : touch space test dot txt nion Enter.
08:32 Nangta pynlong ia ka script executable da kaba type:

chmod space plus x space logicalNOT dot sh nion Enter.

08:45 Mynta , type: dot slash logicalNOT dot sh space test dot txt nion Enter.
08:55 Ka shell script jong ngi kan check la ka file ka don ne em.
09:00 Ka file test dot txt jong ngi ka don, kumta u value un dei True.
09:07 Nangta u logical NOT un pynkylla ia u value bad return False.
09:12 Namar ba ka evaluation kadeiFalse, ka else statement ka shah evaluate.
09:18 Bad ka message kaba la pyni kadei -File 'test.txt' exists.
09:23 Pyrshang ban execute ia ka program sa shisien ryngkat bad ka argument test1.txt.
09:29 Bad peit ia ka jingiaid u control flow kumba la batai hashwa.
09:33 Phai biang sha ki slides jong ngi. To ngin batai kyllum
09:37 Ha kane ka jinghikai, ngi la pule ia ki jingdonkam jong:

logical AND logical OR bad logical NOT.

09:45 Kum ka kam na ka bynta jong phi.
09:47 Check la ka file ka don ne em
09:49 Bad ka long ban execute
09:51 Da kaba pyndonkam logical operators ba la batai ha kane ka jinghikai
09:56 (Hint: man space test)
09:59 Peit ia ka video ba don ha ka link ba la ai harum
10:02 Ka batai kyllum ia ka Spoken-Tutorial project.
10:05 Lada phim don ia ka bandwidth kaba biang , phi lah ban shu download bad peit ia ka .
10:09 Ka kynhun jong ka Spoken-Tutorial Project
10:12 Ka pynlong ia ki workshops da kaba pyndonkam da ki spoken tutorials.
10:15 Ka ai sertiphikate sha kito kiba pass ha ka online test.
10:19 Na ka bynta ki jingtip ba bniah, sngewbha thoh sha ka contact@spoken-tutorial.org
10:26 Spoken Tutorial Projek kadei shibynta jong ka "Talk to a Teacher" projek.
10:30 La kyrshan ia ka da ka National Mission on Education lyngba ka ICT, MHRD, Sorkar India.
10:37 Kham bun ki jingtip halor kane ka mission kidon ha ka link ba la ai harum http://spoken-tutorial.org/NMEICT-Intro
10:42 Kane ka script la noh synniang da ka FOSSEE bad ka kynhun jong ka Spoken-Tutorial .
10:47 Bad nga I Meboreen na Shillong , nga pynkut ia kane.
10:51 Khublei shibun ia ka jingsnohkti lang jong phi.

Contributors and Content Editors

Meboreen Mary