20.3 Listing directory entries

Function: mbfl_file_enable_listing

Declare the commands required to retrieve informations about files and directories. Declaring the intention to use a program

The programs are: ls, readlink.

Function: mbfl_file_listing PATHNAME OPT

Execute the program ls with PATHNAME as argument. If other arguments are present: they are inserted as options in the command line of ls.

Function: mbfl_file_long_listing PATHNAME OPT

Execute the program ls with PATHNAME as argument and the flag -l. If other arguments are present: they are inserted as options in the command line of ls.

Execute the program readlink to normalise the pathname of a symbolic link (remember that a symbolic link references a file, never a directory). Echo to stdout the normalised pathname.

The command line of readlink is:

readlink  --canonicalize --no-newline "$PATHNAME"

Execute the program readlink to acquire the original pathname referenced by PATHNAME, then print it. If other arguments are present: they are inserted as options in the command line of readlink.

Function: mbfl_exec_ls ARG

Execute the program ls with the given optional command line arguments.

Execute the program readlink with the given optional command line arguments.


This document describes version 3.0.0-devel.9 of Marcos Bash Functions Library.