diff --git a/Documentation/Models/Docbook/Tcar-ug/Scripts/Bash/cli_checkFiles.docbook b/Documentation/Models/Docbook/Tcar-ug/Scripts/Bash/cli_checkFiles.docbook index 49f3d70..1e7b111 100644 --- a/Documentation/Models/Docbook/Tcar-ug/Scripts/Bash/cli_checkFiles.docbook +++ b/Documentation/Models/Docbook/Tcar-ug/Scripts/Bash/cli_checkFiles.docbook @@ -1,16 +1,52 @@ -
+ + + + cli_checkFiles + 1 + + Standardize constructions for file verifications + + + + + cli_checkFiles + Standardize constructions for file verifications. + + + + + cli_checkFiles + + -d + -e + -f + -h + -x + + LOCATION + + - Standardizing File Verifications - - cli_checkFiles - + + Description + + The cli_checkFiles exists to answer basic + questions like Is LOCATION + is a regular file? and Is + LOCATION a directory?. The + answer to such questions affects the script execution flow in + the following way: when the answer positive (e.g., + LOCATION is a regular file), the + script passes the test silently and continues its execution. + When the answer is negative(e.g., + LOCATION is not a regular file), + the script finishes its execution immediately with an error + message. + - The file verification tasks are implemented through - cli_checkFiles function inside the - centos-art.sh script. The - cli_checkFiles function is exported to - centos-art.sh script environment in the + The cli_checkFiles function is exported + to centos-art.sh script environment in the very beginning of its execution and will be available all along its execution lifetime. You can use this function inside common and specific functions whenever you need to verify @@ -18,38 +54,33 @@ - The cli_checkFiles answers basic - questions like Does location - is a regular file? and Does - location is directory?. - When the answer to such questions is positive, the script - passes the test silently and continues its execution. When - the answer is negative, the script finishes its execution - immediately with an error message. + The cli_checkFiles function is available + inside the centos-art.sh script only as + part of its execution environment. This function is exported + to centos-art.sh script just after + executing the script from the command-line and will be + available all along the script lifetime. So, you can use this + function both in common and specific functionalities of + centos-art.sh script. - Use the cli_checkFiles function whenever - you need to verify the characteristics of different file types - (e.g., regular files, directories, links, etc.) inside &TCAR;. + The cli_checkFiles function doesn't + create subsequent execution environments. + - - Syntax - - cli_checkFiles - - -d - -e - -f - -h - -x - - LOCATION - - + + Usage + + Use the cli_checkFiles function inside + centos-art.sh script whenever you need to + control the script execution flow based on file type (e.g., + regular files, directories, links, etc.) verifications. + + - + Options The cli_checkFiles function accepts the @@ -125,31 +156,52 @@ The value of the LOCATION argument must be an absolute path to the file you want to verify. If - such file doens't exists in any supported form, the script + such file doesn't exists in any supported form, the script finishes its execution with an error message. - - - - Description - - The cli_checkFiles function is available - inside the centos-art.sh script only as part of its execution - environment. This function is exported to centos-art.sh script - just after executing the script from the command-line and will - be available all along the script lifetime. So, you can use - this function both in common and specific functionalities of - centos-art.sh script. - - - - The cli_checkFiles function doesn't - create subsequent execution environments. - - - - - + + + + Examples + + The following example was taken from + centos-art.sh script initialization phase. + Notice the position of cli_checkFiles + function inside the loop. If some of the function files we + need to export doesn't have execution rights, + cli_checkFiles will + finish the script execution immediately with an error message. + + +# Process the list of files. +for FUNCFILE in $FUNCFILES;do + + # Verify the execution rights for function file. + cli_checkFiles -x ${FUNCFILE} + + # Initialize the function file. + . ${FUNCFILE} + + # Export the function names inside the file to current shell + # script environment. + export -f $(egrep "${PATTERN}" ${FUNCFILE} | gawk '{ print $2 }') + +done + + + + + Bugs + + To report bugs related to this function, please create a new + ticket at refering the + name of this function clearly and the specific problems you + found in it. + + + + Authors @@ -158,9 +210,9 @@ - + - + License @@ -187,6 +239,7 @@ Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - + + + -