Искусство программирования на языке сценариев командной оболочки




Программирование на языке сценариев командной оболочки - стр. 324


# Here document used as a comment block. : << LSfieldsDoc # # # # # List Filesystem Directory Information # # # # # # # ListDirectory "FileGlob" "Field-Array-Name" # or # ListDirectory -of "FileGlob" "Field-Array-Filename" # '-of' meaning 'output to filename' # # # # #

String format description based on: ls (GNU fileutils) version 4.0.36

Produces a line (or more) formatted: inode permissions hard-links owner group ... 32736 -rw------- 1 mszick mszick

size day month date hh:mm:ss year path 2756608 Sun Apr 20 08:53:06 2003 /home/mszick/core

Unless it is formatted: inode permissions hard-links owner group ... 266705 crw-rw---- 1 root uucp

major minor day month date hh:mm:ss year path 4, 68 Sun Apr 20 09:27:33 2003 /dev/ttyS4 NOTE: that pesky comma after the major number

NOTE: the 'path' may be multiple fields: /home/mszick/core /proc/982/fd/0 -> /dev/null /proc/982/fd/1 -> /home/mszick/.xsession-errors /proc/982/fd/13 -> /tmp/tmpfZVVOCs (deleted) /proc/982/fd/7 -> /tmp/kde-mszick/ksycoca /proc/982/fd/8 -> socket:[11586] /proc/982/fd/9 -> pipe:[11588]

If that isn't enough to keep your parser guessing, either or both of the path components may be relative: ../Built-Shared -> Built-Static ../linux-2.4.20.tar.bz2 -> ../../../SRCS/linux-2.4.20.tar.bz2

The first character of the 11 (10?) character permissions field: 's' Socket 'd' Directory 'b' Block device 'c' Character device 'l' Symbolic link NOTE: Hard links not marked - test for identical inode numbers on identical filesystems. All information about hard linked files are shared, except for the names and the name's location in the directory system. NOTE: A "Hard link" is known as a "File Alias" on some systems. '-' An undistingushed file

Followed by three groups of letters for: User, Group, Others Character 1: '-' Not readable; 'r' Readable Character 2: '-' Not writable; 'w' Writable Character 3, User and Group: Combined execute and special '-' Not Executable, Not Special 'x' Executable, Not Special 's' Executable, Special 'S' Not Executable, Special Character 3, Others: Combined execute and sticky (tacky?) '-' Not Executable, Not Tacky 'x' Executable, Not Tacky 't' Executable, Tacky 'T' Not Executable, Tacky




Содержание  Назад  Вперед