27.08.2015 Views

Advanced Bash−Scripting Guide

Advanced Bash-Scripting Guide - Nicku.org

Advanced Bash-Scripting Guide - Nicku.org

SHOW MORE
SHOW LESS
  • No tags were found...

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

# Saves stdin.<br />

<strong>Advanced</strong> <strong>Bash−Scripting</strong> <strong>Guide</strong><br />

exec < data−file<br />

read a1<br />

read a2<br />

# stdin replaced by file "data−file"<br />

# Reads first line of file "data−file".<br />

# Reads second line of file "data−file."<br />

echo<br />

echo "Following lines read from file."<br />

echo "−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−"<br />

echo $a1<br />

echo $a2<br />

echo; echo; echo<br />

exec 0

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!