Bash Shell Scripting
Crash Course
crowfly.net

<<   >>

Introduction

GNU_Tools

Example1

Example2

Execution_bit

Bang_bin_bash

Example3

The_dot

Example4

Example5

Example6

Example7

Example8

Background

Forking

Example9

Bash_profile

Pattern_match

Regex

Debug

Gory_details

References

<<   >>
Regular Expression

Regular Expressions Rule!

They can be found in all modern programming languages including: bash, java, perl, javascript, and php.

grep is the original regular expression parser. It stands for GNU Regular Expression Parser.

Here are some examples:

Carrot (^) means the beginning of line:

  dlink@viddev1> grep "^sub " Calendar.pm
  sub new { return bless {} }
  sub run {
  sub get_date_messages {
  sub html_cell {

Dollar sign ($) means the end of line:

  dlink@viddev1> ls -1 *.css | sed "s/$/,/"
  main.css,
  reftable_results.css,
  searcher.css,
  search_results.css,
  tableUpdate.css,
  titleNav.css,
  user_results.css,

Brackets ([...]) are for lists and ranges of values:

  dlink@viddev1> ls video5[3-5]*.fil
  video530.fil  video551.fil  video554.fil  video556.fil  video558.fil
  video535.fil  video552.fil  video555.fil  video557.fil  video559.fil

Perl has a much better set of regex expressions. See: en.wikipedia.org/wiki/Perl_regular_expression_examples"