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...

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

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

netstat −s | grep "packets received" # Get some connect statistics.<br />

netstat −s | grep "packets delivered"<br />

sleep $INTERVAL<br />

echo; echo<br />

done<br />

exit 0<br />

# As it stands, this script must be terminated with a Control−C.<br />

# Exercises:<br />

# −−−−−−−−−<br />

# Improve the script so it exits on a "q" keystroke.<br />

# Make the script more user−friendly in other ways.<br />

In general, it is dangerous to write to the files in /proc, as this can corrupt the filesystem or crash the<br />

machine.<br />

Chapter 28. /dev and /proc 315

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

Saved successfully!

Ooh no, something went wrong!