BASH/C2/Basics-of-Shell-Scripting/Khasi
From Script | Spoken-Tutorial
Revision as of 17:07, 30 April 2017 by Meboreen Mary (Talk | contribs)
Time | Narration |
00:01 | Ngi pdiangsngewbha ia phi sha ka spoken tutorial halor ka Basics of Shell Scripting. |
00:05 | Ha kane ka jinghikai, ngin pule shaphang: |
00:09 | System variables |
00:11 | User defined variables bad |
00:13 | Ban accept ia ka user input lyngba ka keyboard. |
00:16 | Ban bud ia kane ka jinghikai phi dei ban nang bad tip ia ka Linux Operating System. |
00:23 | Lada phim pat tip, te na ka bynta ki jinghikai ba iadei bad ka Linux, peit ia ka website jong ngi ba la pyni hangne |
00:29 | Na ka bynta kane ka jinghikai, nga pyndonkam: |
00:32 | Ubuntu Linux 12.04 OS bad |
00:35 | GNU Bash version 4.1.10 |
00:40 | Sngewbha kynmaw, ka GNU Bash version 4 lane kiba kham shajrong la ai jingmut na ka bynta kane ka jinghikai |
00:46 | To ngin sdang da ka lamphrang sha ki variables. |
00:49 | Bash variables ka ai ia ka storage ba shipor na ka bynta ki information. |
00:55 | Kine ki variables lah ban pyndonkam hapoh jong ka katba ka program ka dang don |
01:01 | Don ar jait ki variables: System variables,User defined variables . |
01:07 | System variables: Kine la shna bad pynbiang da ka Linux Bash Shell hi. |
01:14 | La batai lane define ia ki da ki dak heh. |
01:17 | Ki system variables ba ju pyndonkam barabor kidei |
01:20 | BASH_VERSION . HOSTNAME |
01:23 | HOME etc |
01:25 | To ngin plié ia ka terminal da kaba nion Ctrl, Alt bad T keys ha kajuh ka por na ka keyboard jong phi. |
01:33 | Mynta , type: set bad nion Enter. |
01:38 | Kane kan pyni ia baroh ki system variables. |
01:42 | Ha kawei pat ka rukom, phi lah ban type envlane printenv ban peit ia baroh ki system variables. |
01:53 | To ngan clear ia ka prompt. |
01:55 | Mynta , type: echo space hapoh double quotes dollar sign HOSTNAME |
02:01 | Mynta nion Enter. |
02:04 | Ka hostname jong ka system kan sa paw. |
02:07 | Mynta to ngin wad ia ka path ba pura jong ka homedirectory. |
02:11 | Type: echo space hapoh double quotes dollar sign HOME(ha ki dak heh). |
02:18 | Nion Enter. |
02:21 | Ka path bapura jong ka user's home directory kan sa paw. |
02:26 | Mynta , type:echo space hapoh double quotes HOME (ha ki dak heh). |
02:32 | Nion Enter. |
02:34 | Kane kan sa pynpaw tang ia ka "HOME", ym ia ka value jong ka HOME variable. |
02:39 | Te , ka long kaba donkam ban pyndonkam ia u dollar sign( $) ha shwa jong man ki variable ban display ia ka value jong u |
02:48 | To ngin phai biang sha ki slides jong ngi. |
02:51 | User Defined Variables: |
02:53 | Kine ki variables la shna bad pynbiang da ki nong pyndonkam lane ki users. |
02:57 | Kalong kaba dei ban kiar na ki uppercase na ka bynta ki kyrteng jong ki user defined variables. |
03:05 | Kane ka pynsuk ban pyniapher hadpeng ki user defined bad system variables. |
03:12 | Phai biang sha ka terminal jong ngi. |
03:14 | Type: username equal to sign sunita |
03:20 | Sngewbha kynmaw ba kam dei ban don blank space hapdeng ka username, equal to sign bad sunita. |
03:29 | Mynta, nion Enter. Ban pyni ia ka value jongvariable username, |
03:33 | Type: echo space hapoh double quotes dollar sign username |
03:40 | Nion Enter. |
03:42 | Kane kan sa pyni sunita ha ka terminal jong phi |
03:46 | U value jong u variable lah ban unset |
03:50 | To ngin phai biang sha ki slides jong ngi. |
03:52 | unset- u value jong u variable lah ban unset da kaba pyndonkam ia ka unset command. |
03:59 | Ka syntax na ka bynta kane kadei - unset variablename |
04:03 | To ngin pyndonkam ia ka nuksa ba hashwa ha kaba username udei u variable jong ngi. |
04:08 | Phai biang sha ka Terminal. Mynta type: unset space username, nionEnter. |
04:18 | To ngin check. Type: echo space hapoh double quotes dollar sign username nion Enter. |
04:28 | Kan nym paw eiei ha ka terminal. |
04:30 | Kane ka mut ba u value jong variable username la dep weng. |
04:36 | Mynta phai biang sha ka slide jong ngi. |
04:39 | Global bad local variables: |
04:42 | Ha Shell script, user defined variables lah ban pynlong globally lane locally. |
04:49 | Kumba ka long hi, baroh ki variables kidei global. |
04:52 | kaba kamut, ki values jong ki kin neh kumjuh hapoh bad shabar jong ka function. |
04:59 | To ngin pule kumno ban declare ia ki variables globally bad locally. |
05:04 | Phai sha ka terminal . Type: |
05:07 | gedit space g_(underscore)variable.sh space & (ampersand sign). |
05:16 | gedit kadei ka text editor g_(underscore) variable.sh kadei ka file name jong ngi. |
05:23 | Bad '&' (ampersand) la ju pyndonkam ban pyllait ia ka prompt. |
05:28 | Nion Enter. |
05:30 | Type ia u code kumba la pyni hangne, ha ka g_(underscore)variable.sh" file jong phi. |
05:35 | To ngan batai ia u code mynta. |
05:38 | Ka line banyngkong ba don u hash bad u dak exclamation ka dei shebang lane ka bang line. |
05:44 | username=sunita kadei userdefined variable bad ia ka la declare globally. |
05:51 | echo kan pyni ia kastring "outside function:" bad |
05:55 | dollar username kan print ia u value jong u variable username. |
06:00 | Kane kadei kumno ngi define ia ka function ha BASH script. |
06:04 | Ngin sa iakren shaphang ki functions ha ka rukom ba bniah , ha ki jinghikai ba shadien. |
06:09 | Kane ka dei ka body jong ka function. |
06:12 | Hangne, sa kawei ka khubor "inside function" kan sa paw ryngkat bad u value jong username. |
06:19 | Hangne ngi call ia ka function. |
06:21 | Kane kadei ka code jong ngi. Mynta, to ngin execute ia ka. |
06:23 | Phai biang sha ka Terminal jong ngi. |
06:26 | To ngan clear ia ka prompt. |
06:28 | Nyngkong ngi donkam ban pynlong ia ka file jong ngi executable. |
06:31 | Type: chmod space plus x space g_(underscore)variable.sh, nion Enter. |
06:39 | Mynta, type: dot slash g_(Underscore)variable.sh |
06:45 | Nion Enter. |
06:47 | Peit ia ka output. Shabar jong ka function, username ka shim ia u valuesunita. |
06:53 | Hapoh jong ka function ruh, username ka shim ia ujuh u value sunita. |
06:59 | Kane kadei namar ba ka username la declare globally shabar jong ka function. |
07:04 | Kaba bud, to ngin pule kumno ban declare ia u variable locally. |
07:09 | Type: gedit space l_(Underscore)variable.sh space & (ampersand sign). |
07:18 | Nion Enter. |
07:20 | Type ia u code kumba la pyni hangne, ha ka "l_(underscore)variable.sh" file jong phi. |
07:25 | To ngan batai ia u code. |
07:28 | U code udei ujuh kum uba hashwa lait noh ia u code ha u lain ba tam hapoh ka function. |
07:36 | Hapoh jong ka function block, ngi don ia ka line- local space username equals to jack. |
07:41 | Kane ka ai ia u value bathymmai na ka bynta u variable username locally. |
07:48 | Mynta switch sha ka Terminal. |
07:50 | To ngan pynlong ia ka file executable. |
07:52 | Da kaba type chmod space plus x space l_variable.sh |
08:00 | Nion Enter. |
08:02 | Type: dot slash l_variable.sh |
08:07 | Nion Enter. Ka output la pyni. |
08:10 | Shabar jong ka function, username ka shim ia u value sunita. |
08:15 | Katba hapoh ka function, username ka shim ia u value jack. |
08:20 | Kane kadei namar ba ka username la ai ia une u value locally, hapoh ka function. |
08:26 | Mynta to ngin iapeit kumno ban ioh ia ka user input lyngba ka keyboard |
08:31 | Ka read command ka iarap ban shim ia ka input na ka keyboard. |
08:36 | La pyndonkam ruh ia ka ban ai ia u input value sha u user defined variable. |
08:41 | Ka syntax jong ka read command kadei- |
08:44 | read space hyphen p space within double quotes PROMPT |
08:50 | Sngewbha kynmaw ba ka PROMPT kadei tang ka string kaba ap ia ka user input. |
08:55 | Phi lah ban bujli ia ka bad ka string jong phi hi. |
08:58 | Mynta , phai biang sha ka terminal . |
09:00 | Type: gedit space read.sh space & (ampersand sign) |
09:08 | Nion Enter. Type ia u code kumba la pyni hangne ha ka "read.sh" file jong phi. |
09:14 | To ngan batai ia u code. |
09:16 | Ha kane ka nuksa, input la ai na ka keyboard da u user. |
09:21 | Kane kadei ka bang line. |
09:23 | Hangne -p u pyni ia u prompt khlem u newline bad shim ia ka input na ka keyboard. |
09:31 | Ka user input yn sa buh ha ka variable username. |
09:36 | echo command ka pyni ia ka message |
09:38 | Hello bad ka kyrteng ba la pyndap da u user lyngba ka keyboard. |
09:43 | Te, to ngin execute ia kane ka program. |
09:45 | Phai biang sha ka terminal jong ngi. |
09:49 | Type: chmod space plus x space read.sh |
09:55 | Nion Enter. |
09:56 | Type: dot slash read.sh nion Enter. |
10:01 | Hangne ka pyni Enter username: |
10:04 | Nga type ashwini, nionEnter. |
10:08 | Ka message Hello ashwini ka paw. |
10:13 | ashwini la ai kum ka input value sha u user defined variable username. |
10:20 | To ngin phai biang sha ki slides jong ngi bad batai kyllum |
10:23 | Ha kane ka jinghikai, ngi la pule shaphang |
10:26 | System variables , User defined variables bad |
10:29 | Ban pdiang ia ka user input lyngba ka keyboard. |
10:33 | Kum ka kam na ka bynta jong phi- Thoh ia ka Bash program basuk ban ioh ia ki system variables harum. |
10:38 | pwd bad * logname. |
10:41 | Thoh ia ka Bash program basuk |
10:43 | Ban pan ia ka username na u user |
10:46 | Ban exit na ka program, lada u user um pyndap eiei hapoh 10 seconds. |
10:51 | {Hint: read -(Hyphen)t 10 -(Hyphen)p} |
10:56 | Peit ia ka video ba don ha ka link ba la ai harum |
10:59 | Ka batai kyllum ia ka Spoken-Tutorial project. |
11:02 | Lada phim don ia ka bandwidth kaba biang , phi lah ban shu download bad peit ia ka . |
11:07 | Ka kynhun jong ka Spoken-Tutorial Project :
Ka pynlong ia ki workshops da kaba pyndonkam da ki spoken tutorials. Ka ai sertiphikate sha kito kiba pass ha ka online test. |
11:16 | Na ka bynta ki jingtip ba bniah, sngewbha thoh sha ka contact@spoken-tutorial.org |
11:23 | Spoken Tutorial Projek kadei shibynta jong ka "Talk to a Teacher" projek. |
11:27 | La kyrshan ia ka da ka National Mission on Education lyngba ka ICT, MHRD, Sorkar India. |
11:34 | Kham bun ki jingtip halor kane ka mission kidon ha ka link ba la ai harum http://spoken-tutorial.org/NMEICT-Intro |
11:40 | Kane ka script la noh synniang da ka FOSSEE bad ka kynhun jong ka Spoken-Tutorial . |
11:44 | Bad nga I Meboreen na Shillong , nga pynkut ia kane. Khublei shibun ia ka jingsnohkti lang jong phi. |