Unix Shell Scripts   «Prev 

Defining a Shell Script File

A valid script is marked with correct file permissions and includes valid commands.

  1. The file permissions are set to include Execute (x)
  2. The first line of the script includes the path of the script interpreter (the Bourne shell)
  3. The script contains valid commands

Wild cards (Filename Shorthand or meta Characters)

Wild Cards

Note: [..-..] A pair of characters separated by a minus sign denotes a range. Example: $ ls /bin/[a-c]* Will show all files name beginning with letter a,b or c like
/bin/arch /bin/awk /bin/bsh /bin/chmod /bin/cp
/bin/ash /bin/basename /bin/cat /bin/chown /bin/cpio
/bin/ash.static /bin/bash /bin/chgrp /bin/consolechars /bin/csh

$ ls /bin/[!a-o]
$ ls /bin/[^a-o]

If the first character following the [ is a ! or a ^ ,then any character not enclosed is matched i.e. do not show us file name that beginning with a,b,c,e...o, like