Difference between revisions of "BASH/C3/Basics-of-Redirection-(error-handling)/English-timed"

From Script | Spoken-Tutorial
Jump to: navigation, search
(Created page with "'''­Title of script: Basics of redirection''' '''Author:''' Lavitha Pereira '''Keywords: Video tutorial, redirection, file descriptors, standard input, standard output, sta...")
 
 
(8 intermediate revisions by 3 users not shown)
Line 1: Line 1:
'''­Title of script: Basics of redirection'''
+
{|border=1
 
+
|''' Time'''
'''Author:''' Lavitha Pereira
+
 
+
'''Keywords: Video tutorial, redirection, file descriptors, standard input, standard output, standard error'''
+
 
+
 
+
{| border=1
+
|''' Visual Cue'''
+
 
|'''Narration'''
 
|'''Narration'''
  
 
|-
 
|-
 
| 00:01
 
| 00:01
| Dear friends, welcome to the spoken tutorial on''' Basics of redirection'''
+
| Dear friends, welcome to the '''spoken tutorial''' on''' Basics of redirection'''.
  
 
|-
 
|-
 
| 00:07
 
| 00:07
| In this tutorial, we will learn
+
| In this tutorial, we will learn:
  
 
|-
 
|-
 
| 00:10
 
| 00:10
|Input and output in '''Bash'''
+
|'''input''' and '''output''' in '''Bash'''
  
 
|-
 
|-
 
| 00:12
 
| 00:12
| Redirection and file descriptors  
+
|'''Redirection''' and '''file descriptors'''
  
 
|-
 
|-
 
| 00:15
 
| 00:15
|Standard input
+
|'''standard input''' '''standard output'''
 
+
|-
+
| 00:16
+
| Standard output
+
  
 
|-
 
|-
 
| 00:18
 
| 00:18
| Standard error
+
|'''standard error'''with the help of some examples.
 
+
|-
+
| 00:19
+
|With the help of some examples  
+
  
 
|-
 
|-
 
| 00:22
 
| 00:22
| To follow this tutorial you should have knowledge of '''Shell Scripting''' in''' BASH.'''
+
| To follow this tutorial, you should have knowledge of '''Shell Scripting''' in''' BASH.'''
  
 
|-
 
|-
 
| 00:28
 
| 00:28
|If not, for relevant tutorials please visit our website which is as shown,'''(http://www.spoken-tutorial.org)'''
+
|If not, for relevant tutorials, please visit our website which is as shown. http://www.spoken-tutorial.org
  
 
|-
 
|-
 
| 00:34
 
| 00:34
| For this tutorial I am using
+
| For this tutorial, I am using:
  
 
|-
 
|-
 
| 00:36
 
| 00:36
| '''Ubuntu Linux''' 12.04 '''Operating System''' and
+
|'''Ubuntu Linux''' 12.04 '''Operating System''' and
  
 
|-
 
|-
 
| 00:40
 
| 00:40
| '''GNU BASH''' version 4.2
+
|'''GNU BASH''' version 4.2
  
 
|-
 
|-
 
| 00:43
 
| 00:43
|Please note,''' GNU Bash''' '''version 4''' or above is recommended for practice.
+
|Please note,''' GNU Bash''' version 4 or above is recommended for practice.
  
 
|-
 
|-
 
| 00:50
 
| 00:50
| In '''GNU/Linux '''we can send output to a file or read input from a file.
+
| In '''GNU/Linux '''we can send '''output''' to a file or read '''input''' from a file.
  
 
|-
 
|-
 
| 00:58
 
| 00:58
| Each '''Shell''' command has its own inputs and outputs
+
| Each '''Shell''' '''command''' has its own inputs and outputs.
  
 
|-
 
|-
 
| 01:03
 
| 01:03
|Input and output is redirected using a special notation interpreted by the '''Shell'''
+
|Input and output is redirected using a special notation interpreted by the '''Shell'''.
  
 
|-
 
|-
 
| 01:11
 
| 01:11
|  Changing the default path of input or output is called as''' redirection'''
+
|  Changing the default path of input or output is called as''' redirection'''.
  
 
|-
 
|-
 
| 01:18
 
| 01:18
| In GNU/Linux everything is a file, including the hardware
+
| In '''GNU/Linux''' everything is a file, including the hardware.
  
 
|-
 
|-
 
| 01:24
 
| 01:24
 
| Common return values are:
 
| Common return values are:
 +
 
|-
 
|-
 
| 01:27
 
| 01:27
| '''0''' for '''Input''' i.e. '''Keyboard'''  
+
|'0' for '''input''' i.e. '''keyboard'''  
 +
 
 
|-
 
|-
 
| 01:31
 
| 01:31
| '''1''' for '''Output''' i.e. '''Screen '''
+
|'1' for '''output''' i.e. '''screen '''
 +
 
 
|-
 
|-
 
| 01:34
 
| 01:34
| '''2 '''for '''Error '''i.e. '''Screen '''
+
|'2' for '''error '''i.e. '''screen. '''
 
+
 
+
 
+
  
 
|-
 
|-
 
|01:38
 
|01:38
|''0, 1, 2 '''are '''POSIX '''numbers and also known as '''file descriptors''' '''(FD''').  
+
|0, 1, 2 are '''POSIX '''numbers and also known as '''file descriptors''' '''(FD''').  
  
 
|-
 
|-
 
| 01:46
 
| 01:46
| A redirector uses '''POSIX''' numbers to talk with a user or other program.  
+
| A '''re-director''' uses '''POSIX''' numbers to talk with a user or other program.  
  
 
|-
 
|-
 
| 01:54
 
| 01:54
|  Standard input: Standard input is the default input method
+
'''Standard input''': standard input is the default input method.
  
 
|-
 
|-
 
| 02:00
 
| 02:00
 
|  It is used by all commands to read input.  
 
|  It is used by all commands to read input.  
 +
 
|-
 
|-
 
| 02:04
 
| 02:04
 
| It is denoted by zero (0).  
 
| It is denoted by zero (0).  
 +
 
|-
 
|-
 
| 02:07
 
| 02:07
|  Also known as '''stdinb(Standard input). '''
+
|  Also known as '''stdin (Standard input).'''
  
 
|-
 
|-
 
| 02:13
 
| 02:13
|  The default standard input is the keyboard.  
+
|  The default '''standard input''' is the keyboard.  
  
 
|-
 
|-
 
| 02:17
 
| 02:17
|   '''Less than '''symbol is input redirection symbol
+
| '''Less than '''symbol is '''input redirection''' symbol.
  
 
|-
 
|-
 
| 02:22
 
| 02:22
|  The syntax is '''Command space less than symbol space filename'''
+
|  The syntax is- '''command''' space less than symbol space '''filename'''.
 
+
  
 
|-
 
|-
 
| 02:30
 
| 02:30
| Let me open a file named '''redirection dot sh'''
+
| Let me open a file named '''redirection dot sh'''.
  
 
|-
 
|-
Line 148: Line 134:
 
| 02:37
 
| 02:37
 
| This is the''' shebang line.'''
 
| This is the''' shebang line.'''
 
  
 
|-
 
|-
 
| 02:41
 
| 02:41
|  Type''' sort space less than symbol space file dot txt''
+
|  Type: ''' sort''' space less than symbol space '''file dot txt'''.
 +
 
 
|-
 
|-
 
| 02:48
 
| 02:48
| This is an example of input redirection.
+
| This is an example of '''input redirection'''.
  
|-
+
|-
 
| 02:52
 
| 02:52
| The input is taken from file '''file dot txt'''
+
| The '''input''' is taken from file '''file dot txt'''.
 +
 
 
|-
 
|-
 
| 02:57
 
| 02:57
|  '''sort '''command does the '''sorting '''of numbers present in ''' file dot txt'''
+
|  '''sort '''command does the sorting of numbers present in ''' file dot txt'''.
  
 
|-
 
|-
 
|03:04
 
|03:04
|Click on '''Save'''  
+
|Click on '''Save'''.
  
 
|-
 
|-
 
|03:06
 
|03:06
| Let us run the file ''' redirection dot sh'''  
+
| Let us '''run''' the file ''' redirection dot sh'''.
  
 
|-
 
|-
 
| 03:10
 
| 03:10
| Open the '''terminal''' using '''Ctrl, Alt''' and '''T''' simultaneously on your keyboard.
+
| Open the '''terminal''' using '''Ctrl, Alt''' and '''T''' keys simultaneously on your keyboard.
  
 
|-
 
|-
 
|03:18
 
|03:18
| Before that, let us see the content of '''file dot txt'''
+
| Before that, let us see the contents of '''file dot txt'''.
  
 
|-
 
|-
 
| 03:23
 
| 03:23
| Type '''cat space file dot txt'''.
+
| Type: '''cat space file dot txt'''.
  
 
|-
 
|-
 
| 03:27
 
| 03:27
|Press Enter
+
|Press '''Enter'''.
  
 
|-
 
|-
 
| 03:30
 
| 03:30
|You can see that the file contains series of numbers
+
|You can see that the file contains series of numbers.
  
 
|-
 
|-
 
| 03:35
 
| 03:35
| Now type: '''chmod space plus x space redirection dot sh'''
+
| Now type: '''chmod space plus x space redirection dot sh'''.
  
 
|-
 
|-
Line 202: Line 189:
 
|-
 
|-
 
| 03:45
 
| 03:45
| Type '''dot slash redirection dot sh'''
+
| Type: '''dot slash redirection dot sh'''
 
+
  
 
|-
 
|-
Line 211: Line 197:
 
|-
 
|-
 
|03:51
 
|03:51
| We can see the output on the '''terminal''' after sorting.
+
| We can see the '''output''' on the '''terminal''' after sorting.
  
 
|-
 
|-
Line 219: Line 205:
 
|-
 
|-
 
| 04:00
 
| 04:00
| Come back to our slides.
+
| Come back to our '''slides'''.
  
 
|-
 
|-
 
| 04:03
 
| 04:03
| Standard output: Standard output is used by all commands to display output.  
+
| '''Standard output''': standard output is used by all commands to display output.  
 +
 
 
|-
 
|-
 
| 04:10
 
| 04:10
|  The default output is displayed on the screen.  
+
|  The '''default''' '''output''' is displayed on the screen.  
 +
 
 
|-
 
|-
 
| 04:14
 
| 04:14
Line 237: Line 225:
 
|-
 
|-
 
| 04:23
 
| 04:23
|  ( > )'''Greater than''' symbol is the output redirection symbol  
+
|  ( > )'''Greater than''' symbol is the '''output redirection''' symbol.
  
 
|-
 
|-
 
| 04:28
 
| 04:28
|  Syntax is '''Command space greater symbol space filename'''
+
|  Syntax is '''command''' space greater than symbol space '''filename'''.
  
 
|-
 
|-
 
| 04:35
 
| 04:35
| Let me go back to a file '''redirection dot sh'''
+
| Let me go back to our file '''redirection dot sh'''.
  
 
|-
 
|-
 
| 04:41
 
| 04:41
| Comment the previous line ie. '''sort'''
+
| '''Comment''' the previous line i.e. '''sort'''.
  
 
|-
 
|-
 
| 04:45
 
| 04:45
| Below it, type ''' ls space greater than space ls underscore file.txt'''
+
| Below it, type: '''ls''' space greater than symbol space '''ls underscore file.txt'''
  
 
|-
 
|-
 
| 04:55
 
| 04:55
| This is an example of output redirection.
+
| This is an example of '''output redirection'''.
  
 
|-
 
|-
 
| 04:59
 
| 04:59
| The output of ''''ls'''' will be stored in '''ls_file dot txt '''.
+
| The output of 'ls' will be stored in '''ls_file dot txt '''.
  
 
|-
 
|-
 
| 05:06
 
| 05:06
| '''ls '''command lists the information about files in that particular directory.
+
| 'ls' command lists the information about files in that particular directory.
  
 
|-
 
|-
 
| 05:14
 
| 05:14
|Now, save the file and switch to the '''terminal'''
+
|Now, '''save''' the file and switch to the '''terminal'''.
  
 
|-
 
|-
 
| 05:19
 
| 05:19
| Let me clear the prompt.  First let us type ''''ls'''' and see the output.
+
| Let me clear the '''prompt'''.  First, let us type 'ls' and see the output.
  
 
|-
 
|-
 
| 05:28
 
| 05:28
| Now press the '''uparrow''' key thrice.
+
| Now press the '''up-arrow''' key thrice.
  
 
|-
 
|-
Line 289: Line 277:
 
|-
 
|-
 
| 05:41
 
| 05:41
| Now let us check whether the output is redirected correctly.
+
| Now let us check whether the '''output''' is redirected correctly.
  
 
|-
 
|-
 
| 05:46
 
| 05:46
| Type '''gedit space ls underscore file dot txt '''and press '''Enter.'''
+
| Type: '''gedit space ls underscore file dot txt '''and press '''Enter.'''
  
 
|-
 
|-
 
| 05:56
 
| 05:56
| We can now see the output in this file. So our redirect was successful.
+
| We can now see the '''output''' in this file. So our '''redirect''' was successful.
  
 
|-
 
|-
 
| 06:03
 
| 06:03
| Come back to our slides.   
+
| Come back to our '''slides'''.   
  
 
|-
 
|-
 
| 06:06
 
| 06:06
|  '''Standard error '''is the default output error  
+
|  '''Standard error''': standard error is the default '''output error'''.
  
 
|-
 
|-
 
| 06:12
 
| 06:12
|  It is used to write all system errors  
+
|  It is used to write all system errors.
  
 
|-
 
|-
Line 325: Line 313:
 
|-
 
|-
 
| 06:32
 
| 06:32
|  '''Two greater than symbol (2>)''' is error redirection symbol  
+
|  '''Two greater than symbol (2>)''' is '''error redirection''' symbol.
  
 
|-
 
|-
 
| 06:36
 
| 06:36
| Syntax is '''command space 2 greater than space error dot txt'''
+
| Syntax is '''command space 2 greater than symbol space error dot txt'''.
  
 
|-
 
|-
 
| 06:44
 
| 06:44
| Let me go back to the file '''redirection dot sh'''
+
| Let me go back to the file '''redirection dot sh'''.
  
 
|-
 
|-
 
| 06:49
 
| 06:49
| We will comment the previous line. i.e.'''ls'''
+
| We will comment the previous line. i.e.'ls'.
  
 
|-
 
|-
 
| 06:54
 
| 06:54
| Below it type ''' rm space backslash tmp backslash 4815 dot txt space 2 greater than symbol space error dot txt.'''
+
| Below it, type: ''' rm space backslash tmp backslash 4815 dot txt space 2 greater than symbol space error dot txt.'''
 
+
  
 
|-
 
|-
 
| 07:11
 
| 07:11
| The error output is redirected to '''error dot txt file.'''
+
| The '''error output''' is redirected to '''error dot txt file.'''
  
 
|-
 
|-
 
| 07:17
 
| 07:17
| Now, Click on '''Save''' and switch to the '''terminal'''.
+
| Now, click on '''Save''' and switch to the '''terminal'''.
  
 
|-
 
|-
Line 358: Line 345:
 
|-
 
|-
 
| 07:26
 
| 07:26
| Type '''rm space backslash tmp backslash 4815 dot txt'''
+
| Type: '''rm space slash tmp slash 4815 dot txt'''
  
 
|-
 
|-
Line 366: Line 353:
 
|-
 
|-
 
| 07:38
 
| 07:38
| The error displayed is
+
| The '''error''' displayed is-
  
 
|-
 
|-
 
| 07:40
 
| 07:40
| '''rm: cannot remove slash tmp slash 4815 dot txt: No such file or directory'''
+
| '''rm: cannot remove slash tmp slash 4815 dot txt: No such file or directory'''.
 
+
  
 
|-
 
|-
 
| 07:49
 
| 07:49
| Now we will execute our file.
+
| Now we will '''execute''' our file.
  
 
|-
 
|-
 
|  07:53
 
|  07:53
|  Press the '''uparrow''' key.
+
|  Press the '''up-arrow''' key
  
 
|-
 
|-
 
| 07:55
 
| 07:55
| And, Recall the previous command '''dot slash redirection dot sh'''
+
| and recall the previous '''command''' '''dot slash redirection dot sh'''.
  
 
|-
 
|-
Line 391: Line 377:
 
|-
 
|-
 
| 08:03
 
| 08:03
| Now let us check whether the error is redirected.
+
| Now let us check whether the '''error''' is redirected.
  
 
|-
 
|-
 
| 08:07
 
| 08:07
| Type '''gedit space error dot txt''' and press '''Enter.'''
+
| Type: '''gedit space error dot txt''' and press '''Enter.'''
 
+
  
 
|-
 
|-
 
| 08:15
 
| 08:15
| We can now see the error redirected to file '''error dot txt'''.
+
| We can now see the '''error''' redirected to file '''error dot txt'''.
  
 
|-
 
|-
Line 408: Line 393:
 
|-
 
|-
 
| 08:26
 
| 08:26
| Let us summarise.  
+
| Let us summarize.  
  
 
|-
 
|-
 
| 08:28
 
| 08:28
| In this tutorial we learnt
+
| In this tutorial, we learned:
  
 
|-
 
|-
 
| 08:31
 
| 08:31
| Input and output in Bash
+
|Input and output in Bash
  
 
|-
 
|-
 
| 08:35
 
| 08:35
| Redirection and file descriptors  
+
|'''Redirection''' and '''file descriptors'''
  
 
|-
 
|-
 
| 08:38
 
| 08:38
| Standard input using <(less than) symbol
+
|'''standard input''' using '<' (less than) symbol
  
 
|-
 
|-
 
| 08:42
 
| 08:42
| Standard output using  >(greater than) symbol
+
|'''standard output''' using  '>' (greater than) symbol
 +
 
 
|-
 
|-
 
| 08:47
 
| 08:47
| Standard error using 2> (2 greater than symbol)
+
|'''standard error''' using '2>' (2 greater than symbol).
  
 
|-
 
|-
 
| 08:52
 
| 08:52
| As an assignment,
+
| As an assignment-
  
 
|-
 
|-
 
| 08:54
 
| 08:54
| Write a program in any language like C, C++, Java.
+
| write a program in any language like C, C++, Java  
  
 
|-
 
|-
 
| 08:59
 
| 08:59
| And redirect the output or error to a new file.
+
| and '''redirect''' the '''output''' or '''error''' to a new file.
  
 
|-
 
|-
 
| 09:04
 
| 09:04
| Or, create a text file with some content like your name, address.
+
| Or, create a '''text file''' with some contents like your name, address.
  
 
|-
 
|-
 
| 09:11
 
| 09:11
| Redirect the content to a new file.
+
| '''Redirect''' the contents to a new file.
  
 
|-
 
|-
Line 459: Line 445:
 
|-
 
|-
 
| 09:19
 
| 09:19
| It summarises the Spoken Tutorial project.
+
| It summarizes the Spoken-Tutorial project.
  
 
|-
 
|-
Line 467: Line 453:
 
|-
 
|-
 
| 09:28
 
| 09:28
| The Spoken Tutorial Project Team
+
| The Spoken Tutorial project team:
  
 
|-
 
|-
 
| 09:30
 
| 09:30
| Conducts workshops using spoken tutorials
+
|Conducts workshops using spoken tutorials.
  
 
|-
 
|-
 
| 09:34
 
| 09:34
| Gives certificates to those who pass an online test
+
| Gives certificates to those who pass an online test.
  
 
|-
 
|-
Line 483: Line 469:
 
|-
 
|-
 
| 09:46
 
| 09:46
| Spoken Tutorial Project is a part of the Talk to a Teacher project.
+
| '''Spoken Tutorial''' project is a part of the '''Talk to a Teacher''' project.
 
+
  
 
|-
 
|-
Line 492: Line 477:
 
|-
 
|-
 
| 09:58
 
| 09:58
| More information on this Mission is available at the link shown below.  
+
| More information on this mission is available at the link shown below.  
  
 
|-
 
|-
 
| 10:04
 
| 10:04
 
| The script has been contributed by FOSSEE and Spoken-Tutorial teams.
 
| The script has been contributed by FOSSEE and Spoken-Tutorial teams.
 
  
 
|-
 
|-
 
| 10:10
 
| 10:10
| This is Ashwini from IIT Bombay. Signing off. Thank you for joining
+
| This is Ashwini from IIT Bombay, signing off. Thank you for joining.
  
 
|}
 
|}

Latest revision as of 17:20, 23 March 2017

Time Narration
00:01 Dear friends, welcome to the spoken tutorial on Basics of redirection.
00:07 In this tutorial, we will learn:
00:10 input and output in Bash
00:12 Redirection and file descriptors
00:15 standard input standard output
00:18 standard errorwith the help of some examples.
00:22 To follow this tutorial, you should have knowledge of Shell Scripting in BASH.
00:28 If not, for relevant tutorials, please visit our website which is as shown. http://www.spoken-tutorial.org
00:34 For this tutorial, I am using:
00:36 Ubuntu Linux 12.04 Operating System and
00:40 GNU BASH version 4.2
00:43 Please note, GNU Bash version 4 or above is recommended for practice.
00:50 In GNU/Linux we can send output to a file or read input from a file.
00:58 Each Shell command has its own inputs and outputs.
01:03 Input and output is redirected using a special notation interpreted by the Shell.
01:11 Changing the default path of input or output is called as redirection.
01:18 In GNU/Linux everything is a file, including the hardware.
01:24 Common return values are:
01:27 '0' for input i.e. keyboard
01:31 '1' for output i.e. screen
01:34 '2' for error i.e. screen.
01:38 0, 1, 2 are POSIX numbers and also known as file descriptors (FD).
01:46 A re-director uses POSIX numbers to talk with a user or other program.
01:54 Standard input: standard input is the default input method.
02:00 It is used by all commands to read input.
02:04 It is denoted by zero (0).
02:07 Also known as stdin (Standard input).
02:13 The default standard input is the keyboard.
02:17 Less than symbol is input redirection symbol.
02:22 The syntax is- command space less than symbol space filename.
02:30 Let me open a file named redirection dot sh.
02:34 I have typed some code in this file.
02:37 This is the shebang line.
02:41 Type: sort space less than symbol space file dot txt.
02:48 This is an example of input redirection.
02:52 The input is taken from file file dot txt.
02:57 sort command does the sorting of numbers present in file dot txt.
03:04 Click on Save.
03:06 Let us run the file redirection dot sh.
03:10 Open the terminal using Ctrl, Alt and T keys simultaneously on your keyboard.
03:18 Before that, let us see the contents of file dot txt.
03:23 Type: cat space file dot txt.
03:27 Press Enter.
03:30 You can see that the file contains series of numbers.
03:35 Now type: chmod space plus x space redirection dot sh.
03:43 Press Enter.
03:45 Type: dot slash redirection dot sh
03:48 Press Enter.
03:51 We can see the output on the terminal after sorting.
03:56 The numbers are sorted in ascending order.
04:00 Come back to our slides.
04:03 Standard output: standard output is used by all commands to display output.
04:10 The default output is displayed on the screen.
04:14 It is denoted by number one (1).
04:17 Also known as stdout (Standard output).
04:23 ( > )Greater than symbol is the output redirection symbol.
04:28 Syntax is command space greater than symbol space filename.
04:35 Let me go back to our file redirection dot sh.
04:41 Comment the previous line i.e. sort.
04:45 Below it, type: ls space greater than symbol space ls underscore file.txt
04:55 This is an example of output redirection.
04:59 The output of 'ls' will be stored in ls_file dot txt .
05:06 'ls' command lists the information about files in that particular directory.
05:14 Now, save the file and switch to the terminal.
05:19 Let me clear the prompt. First, let us type 'ls' and see the output.
05:28 Now press the up-arrow key thrice.
05:33 Recall the previous command dot slash redirection dot sh.
05:38 And Press Enter.
05:41 Now let us check whether the output is redirected correctly.
05:46 Type: gedit space ls underscore file dot txt and press Enter.
05:56 We can now see the output in this file. So our redirect was successful.
06:03 Come back to our slides.
06:06 Standard error: standard error is the default output error.
06:12 It is used to write all system errors.
06:16 It is denoted by number two (2).
06:20 Also known as stderr (Standard error).
06:25 The default standard error output is visible on the screen or monitor.
06:32 Two greater than symbol (2>) is error redirection symbol.
06:36 Syntax is command space 2 greater than symbol space error dot txt.
06:44 Let me go back to the file redirection dot sh.
06:49 We will comment the previous line. i.e.'ls'.
06:54 Below it, type: rm space backslash tmp backslash 4815 dot txt space 2 greater than symbol space error dot txt.
07:11 The error output is redirected to error dot txt file.
07:17 Now, click on Save and switch to the terminal.
07:22 We will type a command to see the error first.
07:26 Type: rm space slash tmp slash 4815 dot txt
07:36 Press Enter.
07:38 The error displayed is-
07:40 rm: cannot remove slash tmp slash 4815 dot txt: No such file or directory.
07:49 Now we will execute our file.
07:53 Press the up-arrow key
07:55 and recall the previous command dot slash redirection dot sh.
08:01 Press Enter.
08:03 Now let us check whether the error is redirected.
08:07 Type: gedit space error dot txt and press Enter.
08:15 We can now see the error redirected to file error dot txt.
08:22 This brings us to the end of this tutorial.
08:26 Let us summarize.
08:28 In this tutorial, we learned:
08:31 Input and output in Bash
08:35 Redirection and file descriptors
08:38 standard input using '<' (less than) symbol
08:42 standard output using '>' (greater than) symbol
08:47 standard error using '2>' (2 greater than symbol).
08:52 As an assignment-
08:54 write a program in any language like C, C++, Java
08:59 and redirect the output or error to a new file.
09:04 Or, create a text file with some contents like your name, address.
09:11 Redirect the contents to a new file.
09:15 Watch the video available at the link shown below.
09:19 It summarizes the Spoken-Tutorial project.
09:23 If you do not have good bandwidth, you can download and watch it.
09:28 The Spoken Tutorial project team:
09:30 Conducts workshops using spoken tutorials.
09:34 Gives certificates to those who pass an online test.
09:38 For more details, please write to contact@spoken-tutorial.org
09:46 Spoken Tutorial project is a part of the Talk to a Teacher project.
09:50 It is supported by the National Mission on Education through ICT, MHRD, Government of India.
09:58 More information on this mission is available at the link shown below.
10:04 The script has been contributed by FOSSEE and Spoken-Tutorial teams.
10:10 This is Ashwini from IIT Bombay, signing off. Thank you for joining.

Contributors and Content Editors

PoojaMoolya, Pratik kamble, Sandhya.np14