0% found this document useful (0 votes)
4 views7 pages

Session06C Input and Output Formatting

The document discusses the importance of shell programming for all programmers, focusing on input redirection, reading user input, and understanding file descriptors. Key concepts include using commands with input files, accessing variable values, and the significance of standard input/output/error. The document serves as a guide for mastering these essential shell programming techniques.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views7 pages

Session06C Input and Output Formatting

The document discusses the importance of shell programming for all programmers, focusing on input redirection, reading user input, and understanding file descriptors. Key concepts include using commands with input files, accessing variable values, and the significance of standard input/output/error. The document serves as a guide for mastering these essential shell programming techniques.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Shell Programming

A Necessity for all Programmers

Input Redirection
Nagesh Karmali | Firuza Karmali

Department of Computer Science and Engineering


IIT Bombay
You will learn to ...

• Use input redirection


• Read input from user
• File descriptors

Shell Programming – A Necessity for all Programmers By Nagesh | Firuza 2/7


Input redirection

• Command < Input file


• Any program < Input file

Shell Programming – A Necessity for all Programmers By Nagesh | Firuza 3/7


Read Input from User

• read variable
• Access value: $variable

Shell Programming – A Necessity for all Programmers By Nagesh | Firuza 4/7


File Descriptor

• File handlers
• STDIN: 0
• STDOUT: 1
• STDERR: 2
• Example: ls -l 1> file1 2> file2 and ls -e 1> file1 2> file2

Shell Programming – A Necessity for all Programmers By Nagesh | Firuza 5/7


Now, you can ...

• Use input redirection


• Read input from user
• File descriptors

Shell Programming – A Necessity for all Programmers By Nagesh | Firuza 6/7


Thank you
1

Shell Programming – A Necessity for all Programmers By Nagesh | Firuza 7/7

You might also like