The Gateway to Computer Science Excellence
First time here? Checkout the FAQ!
x
+15 votes
1.8k 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

asked in Operating System by Veteran (59.5k points)
edited by | 1.8k views
+13

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.

Reference:http://www.tldp.org/LDP/abs/html/io-redirection.html

0

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.

1 Answer

+20 votes
Best answer

Answer: (B)

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.

answered by Boss (34k points)
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 ???



Quick search syntax
tags tag:apple
author user:martin
title title:apple
content content:apple
exclude -tag:apple
force match +apple
views views:100
score score:10
answers answers:2
is accepted isaccepted:true
is closed isclosed:true

39,512 questions
46,664 answers
139,703 comments
57,481 users