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

No Plan.<br />

vrfy<br />

Out of security considerations, many networks disable finger and its associated daemon. [32]<br />

Verify an Internet e−mail address.<br />

Remote Host Access<br />

sx, rx<br />

sz, rz<br />

ftp<br />

cu<br />

uucp<br />

telnet<br />

wget<br />

lynx<br />

rlogin<br />

rsh<br />

The sx and rx command set serves to transfer files to and from a remote host using the xmodem<br />

protocol. These are generally part of a communications package, such as minicom.<br />

The sz and rz command set serves to transfer files to and from a remote host using the zmodem<br />

protocol. Zmodem has certain advantages over xmodem, such as greater transmission rate and<br />

resumption of interrupted file transfers. Like sx and rx, these are generally part of a communications<br />

package.<br />

Utility and protocol for uploading / downloading files to / from a remote host. An ftp session can be<br />

automated in a script (see Example 17−7, Example A−5, and Example A−14).<br />

Call Up a remote system and connect as a simple terminal. This is a sort of dumbed−down version of<br />

telnet.<br />

UNIX to UNIX copy. This is a communications package for transferring files between UNIX servers.<br />

A shell script is an effective way to handle a uucp command sequence.<br />

Since the advent of the Internet and e−mail, uucp seems to have faded into obscurity, but it still exists<br />

and remains perfectly workable in situations where an Internet connection is not available or<br />

appropriate.<br />

Utility and protocol for connecting to a remote host.<br />

The telnet protocol contains security holes and should therefore probably be avoided.<br />

The wget utility non−interactively retrieves or downloads files from a Web or ftp site. It works well<br />

in a script.<br />

wget −p http://www.xyz23.com/file01.html<br />

wget −r ftp://ftp.xyz24.net/~bozo/project_files/ −o $SAVEFILE<br />

The lynx Web and file browser can be used inside a script (with the −dump option) to retrieve a file<br />

from a Web or ftp site non−interactively.<br />

lynx −dump http://www.xyz23.com/file01.html >$SAVEFILE<br />

Remote login, initates a session on a remote host. This command has security issues, so use ssh<br />

instead.<br />

Remote shell, executes command(s) on a remote host. This has security issues, so use ssh<br />

Chapter 12. External Filters, Programs and Commands 193

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

Saved successfully!

Ooh no, something went wrong!