Difference between revisions of "BASH/C2/String-and-File-attributes/Tamil"

From Script | Spoken-Tutorial
Jump to: navigation, search
 
Line 10: Line 10:
 
|-
 
|-
 
| 00:13
 
| 00:13
| * '''String comparison''' மற்றும் '''File attributes comparison'''
+
| '''String comparison''' மற்றும் '''File attributes comparison'''
 
|-
 
|-
 
| 00:18
 
| 00:18
Line 19: Line 19:
 
|-
 
|-
 
| 00:25
 
| 00:25
| * '''Ubuntu Linux''' 12.04  
+
| '''Ubuntu Linux''' 12.04  
 
|-
 
|-
 
| 00:30
 
| 00:30
| * '''GNU BASH''' பதிப்பு 4.1.10
+
| '''GNU BASH''' பதிப்பு 4.1.10
 
|-
 
|-
 
| 00:34
 
| 00:34

Latest revision as of 15:08, 3 April 2017

Time Narration
00:01 Bash ல் String மற்றும் File Attributes comparisonகுறித்த ஸ்போகன் டுடோரியலுக்கு நல்வரவு
00:10 இந்த டுடோரியலில் நாம் கற்கபோவது,
00:13 String comparison மற்றும் File attributes comparison
00:18 இதை சில உதாரணங்களின் உதவியுடன் செய்வோம்.
00:22 இந்த டுடோரியலுக்கு நான் பயன்படுத்துவது
00:25 Ubuntu Linux 12.04
00:30 GNU BASH பதிப்பு 4.1.10
00:34 பயிற்சிக்கு GNU Bash பதிப்பு 4 அல்லது அதற்கு மேல் உள்ளவை பரிந்துரைக்கப்படுகிறது.
00:42 ஒரு அறிமுகத்துடன் ஆரம்பிக்கலாம்.
00:45 ஒரு string ஐ ஒப்பிட Bash ல் இரு வழிகள் உள்ளன.
00:49 1) முதலாவது: == (equal to equal to) operator ஐ பயன்படுத்தி
00:53 சமமான இரு stringகளை ஒப்பிட.
00:56 2) இரண்டாவது: != (not equal to) operator.
00:59 சமமில்லாத இரு stringகளை ஒப்பிட.
01:03 ஒரு உதாரணத்தைக் காண்போம்.
01:06 இங்கே user ID ஐ சோதிக்கும் ஒரு எளிய ப்ரோகிராம் உள்ளது.
01:11 உங்கள் எடிடரில் ஒரு file ஐ திறந்து அதை strcompare dot sh என சேமிக்கவும்
01:19 இப்போது, உங்கள் strcompare dot sh file ல் இங்கு காட்டப்படும் code ஐ டைப் செய்க.
01:26 code ஐ விளக்குகிறேன்.
01:28 இது shebang வரி.
01:31 நடப்பு user ன் usernamewhoami command தருகிறது
01:36 if statement variable whoami ன் வெளியீட்டை string “root” உடன் சோதிக்கிறது.
01:44 stringகளை ஒப்பிட இங்கே not-equal to operator ஐ பயன்படுத்தியுள்ளோம்.
01:50 நடப்பு user... root userஇல்லையெனில் இது இந்த statement ஐ echo செய்யும்-
01:57 “You have no permission to run strcompare dot sh as non-root user.”
02:05 இங்கே $0 (dollar zero) ஆனது file ன் பெயரான பூஜ்ஜியமாவது argument.
02:13 user... root user எனில், echo - செய்வது “Welcome root!”
02:18 பின் ப்ரோகிராம்க்கான exit statement உள்ளது.
02:23 இங்கு fi உடன் if statementஐ முடிக்கிறோம்
02:28 exit statement பற்றி மேலும் அறிய நம் ஸ்லைடுகளுக்கு வருவோம்
02:34 ஒவ்வொரு ப்ரோகிராமும் ஒரு exit status ஐ திருப்பும்.
02:38 ஒரு வெற்றிகரமான command பூஜ்ஜியத்தை திருப்புகிறது.
02:42 பிழை உள்ள command பூஜ்ஜியமல்லாத ஒரு மதிப்பை திருப்புகிறது
02:47 இது ஒரு error codeஆக interpret செய்யப்படலாம்.
02:51 exit statement ஆல் திருப்பப்படும் மதிப்பை மறுபயனாக்கலாம்.
02:56 இப்போது, ப்ரோகிராமை இயக்குவோம்.
02:58 Ctrl+Alt மற்றும் T விசைகளை ஒருசேர அழுத்தி டெர்மினல் விண்டோவை திறக்கலாம்.
03:08 முதலில், கணினியின் நடப்பு user ஐ கண்டறிவோம்.
03:12 டைப் செய்க whoami
03:15 எண்டரை அழுத்துக
03:17 இது நடப்பு user ன் பெயரை காட்டும்.
03:21 இப்போது நம் script ஐ executable ஆக மாற்றுவோம்.
03:25 டைப் செய்க chmod +x strcompare dot sh
03:32 டைப் செய்க dot slash strcompare dot sh
03:37 காட்டப்படும் வெளியீடு:
03:39 You have no permission to run dot slash strcompare dot sh as non-root user.
03:47 இப்போது root user ஆக அதே ப்ரோகிராமை இயக்குவோம்
03:52 டைப் செய்க: sudo dot slash strcompare dot sh
03:58 இது password ஐ கேட்கும்.
04:01 இங்கே உங்கள் password ஐ கொடுக்கவும்.
04:04 காட்டப்படும் வெளியீடு: Welcome root!.
04:08 இப்போது file attributes comparison பற்றி அறிவோம்.
04:13 நான் ஏற்கனவே ஒரு உதாரண code ஐ கொண்டுள்ளேன்.
04:17 இந்த ப்ரோகிராமில், கொடுக்கப்பட்ட file உள்ளதா இல்லையா என சோதிப்போம்.
04:23 file1 ஆனது நாம் file ன் path ஐ சேமிக்கும் variable.
04:29 -(hyphen) f command ஆனது file உள்ளதா இல்லையா என சோதிக்கும்
04:33 அது normal file ஆ எனவும் சோதிக்கிறது.
04:37 condition true, எனில் இது "File exists and is a normal file" என echo செய்யும்
04:44 இல்லையெனில் "File does not exist" என echo செய்யும்
04:48 டெர்மினலுக்கு வந்து நம் file ஐ இயக்குவோம்.
04:53 டைப் செய்க chmod plus x fileattrib dot sh
05:00 டைப் செய்க: dot slash fileattrib dot sh
05:05 காட்டப்படும் வெளியீடு:
05:07 File exists and is a normal file.
05:11 இப்போது file காலியா இல்லையா என சோதிப்போம்.
05:16 நம் ப்ரோகிராமை இயக்குவதற்கு முன், ஒரு காலி file empty dot sh ஐ உருவாக்குகிறேன்.
05:24 டைப் செய்க gedit empty dot sh ampersand குறி
05:31 Save மீது க்ளிக் செய்து, பின் file ஐ மூடவும்.
05:35 - (hyphen) f- (hyphen) s attribute ஆக மாற்றுவோம்.
05:41 இங்கே file பெயரையும் மாற்றுவோம்.
05:45 டைப் செய்க empty dot sh
05:47 இப்போது, முதல் echo statement ஐ:
05:51 “File exists and is not empty” என மாற்றுவோம்
05:54 இரண்டாம் echo statement ஐ:
05:57 “File is empty” என மாற்றுவோம்
05:59 Save மீது க்ளிக் செய்க.
06:01 டெர்மினலுக்கு வருவோம்.
06:03 prompt ஐ துடைக்கிறேன்.
06:06 இயக்குவோம்.
06:08 டைப் செய்க dot slash fileattrib dot sh எண்டரை அழுத்துக
06:13 வெளியீடு File is empty.
06:17 இப்போது, file ன் write premission ஐ சோதிக்கும் மற்றொரு file attribute ஐ காண்போம்.
06:24 நம் ப்ரோகிராமுக்கு வருவோம்.
06:26 - (hyphen) s attribute ஐ - (hyphen) w என மாற்றுவோம்.
06:32 இப்போது முதல் echo statement ஐ:
06:36 “User has write permission to this file” என மாற்றுவோம்
06:40 இரண்டாம் echo statement ஐ:
06:43 “User doesn't have write permission to this file” என மாற்றுவோம்
06:47 Save மீது க்ளிக் செய்க.
06:49 இந்த உதாரணத்திற்கு நான் வேறொரு file ஐ பயன்படுத்துகிறேன்.
06:53 read செய்யமுடியாத அல்லது write permission இல்லாத ஒரு file ஐ தேர்ந்தெடுக்கிறேன்.
07:01 filepath“slash etc slash mysql slash debian dot cnf” என மாற்றுகிறேன்
07:10 Save மீது க்ளிக் செய்க.
07:12 ப்ரோகிராமை இயக்குகிறேன்.
07:15 up-arrow key ஐ அழுத்தி Enter ஐ அழுத்துகிறேன்.
07:19 காட்டப்படும் வெளியீடு:
07:21 User doesn't have write permission to this file.
07:26 இப்போது, file attributeகள் சம்பந்தமான மற்றொரு உதாரணத்தைக் காண்போம்.
07:31 இந்த உதாரணத்தில், file2 ஐ விட file1 புதியதா என சோதிப்போம்
07:38 ப்ரோகிராமைக் காண்போம்.
07:40 நம் file பெயர் fileattrib2 dot sh என்பதைக் கவனிக்கவும்
07:46 code ஐ காண்போம்.
07:48 இங்கே இரு variableகள் file1 மற்றும் file2 ஐ கொண்டுள்ளோம்
07:53 இந்த இரு fileகளும் ஏற்கனவே உருவாக்கப்பட்ட காலி fileகள்.
07:58 இங்கே file2 ஐ விட file1 புதியதா என சோதிப்போம்
08:04 condition trueஎனில், file1 is newer than file2 என அச்சடிக்கிறோம்
08:09 Else, file2 is newer than file1.
08:14 இது மற்றொரு if statement.
08:16 இங்கே file2 ஐ விட file1 பழையதா என சோதிக்கிறோம்
08:21 condition true எனில், file1 is older than file2 என அச்சடிக்கிறோம்
08:27 இல்லையெனில் file2 is older than file1 என அச்சடிக்கிறோம்
08:32 நம் terminalக்கு வருவோம்
08:35 முதலில், empty1 dot sh file ஐ edit செய்வோம்
08:39 அதில் ஒரு echo statement ஐ சேர்ப்போம்.
08:42 டைப் செய்க: echo இரட்டை மேற்கோள்களில் Hiii greater குறி empty one dot sh. Enter ஐ அழித்துக.
08:53 இப்போது நம் script ஐ executeable ஆக மாற்றுவோம்.
08:57 டைப் செய்க chmod plus x fileattrib2 dot sh
09:03 இப்போது டைப் செய்க dot slash fileattrib2 dot sh
09:09 காணும் வெளியீடு:
09:11 file1 is newer than file2
09:15 file2 is older than file1
09:19 இப்போது empty2 dot sh file ஐ edit செய்வோம்.
09:23 இங்கேயும் ஒரு echo statement ஐ சேர்க்கிறேன்
09:27 டைப் செய்க echo இரட்டை மேற்கோள்களில் How are you (greater than குறி) >empty2 dot sh.
09:38 prompt ஐ துடைக்கிறேன்.
09:41 இப்போது மீண்டும் நம் script ஐ இயக்குவோம்.
09:45 மேல் அம்பு விசையை அழுத்தவும்.
09:47 dot slash fileattrib2 dot sh க்கு சென்று Enter ஐ அழுத்துக
09:53 இப்போது காணும் வெளியீடு:
09:55 file2 is newer than file1
09:59 மற்றும் file1 is older than file2
10:03 இத்துடன் இந்த டுடோரியல் முடிகிறது.
10:06 சுருங்கசொல்ல.
10:08 இந்த டுடோரியலில் நாம் கற்றது,
10:11 String comparison
10:12 file attributes
10:14 ==(equal to equal to)
10:16 != (not equal to), -f (hyphen f)
10:18 -s(hyphen s), -w(hyphen w)
10:22 -nt(hyphen nt) மற்றும் -ot (hyphen ot)attributeகள்.
10:26 பயிற்சியாக மேலும் சில attributeகளை ஆராய்ந்தறியவும்.
10:29 உதாரணமாக: -r -x மற்றும் -o
10:33 கீழ்க்காணும் இணைப்பில் உள்ள காணொளியைக் காணவும்
10:36 இது ஸ்போகன் டுடோரியல் திட்டம் பற்றி சுருங்க சொல்கிறது
10:40 உங்கள் இணைய இணைப்பு வேகமாக இல்லையெனில் அதை தரவிறக்கிக் காணவும்
10:45 ஸ்போகன் டுடோரியல் திட்டக்குழு ஸ்போகன் டுடோரியல்களைப் பயன்படுத்தி செய்முறை வகுப்புகள் நடத்துகிறது
10:51 இணையத்தில் பரீட்சை எழுதி தேர்வோருக்கு சான்றிதழ்களும் அளிக்கிறது
10:55 மேலும் தகவல்களுக்கு contact@spoken-tutorial.org க்கு மின்னஞ்சல் எழுதவும்.
11:02 ஸ்போகன் டுடோரியல் பாடங்கள் டாக் டு எ டீச்சர் திட்டத்தின் முனைப்பாகும்.
11:06 இதற்கு ஆதரவு இந்திய அரசு துவக்கிய MHRD இன் ஐசிடி மூலம் தேசிய கல்வித்திட்டத்தின் வழியே கிடைக்கிறது.
11:14 இந்த திட்டம் பற்றிய மேலதிக தகவல்கள் கீழுள்ள இணைப்பில் கிடைக்கும் http://spoken-tutorial.org\NMEICT-Intro
11:19 இந்த டுடோரியலை தமிழாக்கம் செய்து குரல் கொடுத்தது ஐஐடி பாம்பேவில் இருந்து பிரியா. நன்றி.

Contributors and Content Editors

Priyacst