2.4k views

I/O redirection

1. implies changing the name of a file

2. can be employed to use an existing file as input file for a program

3. implies connecting $2$ programs through a pipe

4. None of the above

edited | 2.4k views
+23

Redirection simply means capturing output from a file, command, program, script, or even code block within a script and sending it as input to another file, command, program, or script.

0
+1

in layman terms, Redirection is changing the standard input/output devices while executing a command, like for standard input we have keyboard and for standard output we have screen or terminal.

So B suits the best as it means to use an existing input file for taking input , instead of using standard keyboard device. So clearly we have redirected the input from keyboard to file.

Typically, the syntax of these characters is as follows, using < to redirect input, and > to redirect output.

command1 > file1


executes command1, placing the output in file1, as opposed to displaying it at the terminal, which is the usual destination for standard output. This will clobber any existing data in file1.

Using,

command1 < file1


executes command1, with file1 as the source of input, as opposed to the keyboard, which is the usual source for standard input.

command1 < infile > outfile


combines the two capabilities: command1 reads from infile and writes to outfile.

edited by
0
but that's not what is asked in question rt?
0
The questions asks for 'programs' in place of 'commands'. Can a conclusion be drawn from here: http://unix.stackexchange.com/questions/40277/is-there-a-way-to-pipe-the-output-of-one-program-into-two-other-programs ?
+1
I would say 'b' is the answer. 'C' is not correct as IO redirection doesn't imply that. IO redirection can be used for connection is fine.
0
Yes, got it! Corrected.
0

redirection is a technique for moving visitors to a different Web page than the one they request, usually because the page requested is unavailable isn't it ?
so it is something that connects 2 things (program) so by this assumption can we make "c"  as answer ???

1
2