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

<<   >>
Example 4

lshead

  ls -lta $* |head

Output looks like this:

  dlink@viddev1> lshead
  total 118
  drwxr-xr-x   2 dlink viddev  952 2006-07-20 13:57 .
  -rw-rw-r--   1 dlink viddev  225 2006-07-20 13:57 Example4.html
  -rw-rw-r--   1 dlink viddev  531 2006-07-20 13:57 Example2.html
  -rwxr-xr-x   1 dlink viddev 1135 2006-07-20 13:56 course.cgi
  -rw-rw-r--   1 dlink viddev  311 2006-07-20 13:55 Example4.html~
  -rw-rw-r--   1 dlink viddev 2689 2006-07-20 13:54 The_dot.html
  -rw-rw-r--   1 dlink viddev  810 2006-07-20 13:36 The_dot.html~
  -rw-rw-r--   1 dlink viddev  810 2006-07-20 13:35 Bang_bin_bash.html
  -rw-rw-r--   1 dlink viddev 2061 2006-07-20 13:25 Bang_bin_bash.html~
  dlink@viddev1> lshead /data/video/log
  total 224981
  drwxrwxrwx  2 dlink    viddev    17488 2006-07-14 14:02 .
  -rw-r--r--  1 wwwrun   www     1590719 2006-07-14 14:02 usdev8_sql.log
  -rw-r--r--  1 wwwrun   www      305264 2006-07-14 11:39 cadev8_sql.log
  -rw-rw-r--  1 dlink    viddev    18909 2006-07-13 18:00 usdev8_load_fa_2006-07-13.log
  -rw-rw-r--  1 dlink    viddev     6682 2006-07-13 17:50 usdev8_load_2006-07-13.log
  -rw-rw-r--  1 dlink    viddev     2851 2006-07-13 12:04 usdev8_load_fa_2006-07-13.log_1
  -rw-rw-r--  1 dlink    viddev    12933 2006-07-13 11:47 usdev8_load_fa_2006-07-13.log_2
  -rw-rw-r--  1 dlink    viddev    22568 2006-07-13 11:46 usprod8_usdev8_copy_2006-07-13.log
  -rw-rw-r--  1 dlink    viddev     1670 2006-07-13 09:47 usdev8_load_fa_2006-07-13.log_3
  dlink@viddev1> lshead /etc/apache2
  total 545
  drwxr-xr-x  95 root root 10192 2006-07-19 15:50 ..
  drwxr-xr-x   2 root root   368 2006-07-19 15:48 conf.d
  -rw-r--r--   1 root root  1274 2006-07-11 10:38 mod_userdir.conf
  -rw-r--r--   1 root root  7357 2006-05-17 14:59 videoscan.conf
  -rw-r--r--   1 root root  7357 2006-04-24 11:35 videoscan.conf~
  -rw-r--r--   1 root root  7357 2006-04-21 16:18 videoscan.conf.sav
  -rw-r--r--   1 root root  4089 2006-04-03 14:34 videodev.conf
  -rw-r--r--   1 root root  4089 2006-04-03 14:34 videodev.conf_20060403
  -rw-r--r--   1 root root  1463 2006-03-15 15:02 gamescan.conf