Linux Command Line: Day 4: Bash Shell Scripting

Video is ready, Click Here to View ×


Title:
The Linux Command Line: Day 4: Bash Shell Scripting

Notes:

Instructor:
Ershaad Basheer

Venue:
TUE-CMS, Jawaharlal Nehru Centre for Advanced Scientific Research (JNCASR), Bangalore, India

Description:
This series of classes was originally intended to introduce graduate students in the sciences to the Linux command line. The classes were organized and supported by the Thematic Unit of Excellence – Computational Materials Science (TUE-CMS),…

19 Comments

  1. the command ./cwords_1.sh actually starts a shell process which in turn interprets and executes the commands in the cwords_1.sh script. It is to the stdin of this shell that the stdout of the cat command is connected. Now since the stdin is inherited by all processes that are started by this shell, the read command also has the same stdin. try piping a small file to this script, maybe it will help make it clear.

    #!/bin/bash
    read line
    echo first line is $line
    echo Rest of the lines are
    cat

  2. command 1 | command 2 –> connects the stdout file of cmd 1 to stdin file of cmd2.

    cat test.txt | ./cwords_1.sh –> connects the stdout file of cat cmd to stdin file of cwords_1.sh or to the stdin file of read cmd in cwords_1.sh. ? Pls clarify..

Leave a Reply

Your email address will not be published.


*