Exam LFCS All QuestionsBrowse all questions from this exam
Question 87

Which of the following are valid stream redirection operators within Bash? (Choose THREE correct answers.)

    Correct Answer: A, C, D

    The valid stream redirection operators within Bash include: < which is used to redirect standard input from a file, > which is used to redirect standard output to a file, overwriting its previous content, and >> which is used to redirect standard output to a file, appending its content to the end of the file. <<< and %> are not valid stream redirection operators in Bash.

Discussion
rona962Options: ACD

The three valid stream redirection operators within Bash are A. <, C. >, and D. >>. Explanation: < is used to redirect standard input from a file. For example, command < inputfile. <<< is used to redirect standard input from a string. For example, read -r varname <<< "string". > is used to redirect standard output to a file, overwriting its previous content. For example, command > outputfile. >> is used to redirect standard output to a file, appending its content to the end of the file. For example, command >> outputfile. %> is not a valid stream redirection operator in Bash. Therefore, the three valid stream redirection operators in Bash are <, >, and >>.