Mar-10-2017, 03:49 PM
I have to follow some steps ( mandatory ) to complete this task.
get_environment_variable_value()
path_dirs = get_dirs_from_path()
dir_count = get_file_count_for_dir_list(path_dirs)
print_sorted_dictionary(dir_count)
get_environment_variable_value()
- The header for this function must be
get_environment_variable_value(variable_name)
- This function must accept a shell variable as its only parameter
- The function must return the value of this shell variable
- If the variable is not defined, the function must return the empty string
- The header for this function must be
get_dirs_from_path()
- This function must accept no parameters
- This function returns a list of the directories contained in PATH
- The header for this function must be
get_file_count(dir_path)
- This function must accept a directory name as a parameter
- The function must return the number of files in this directory
- Sub-directories must not be included in this count
path_dirs = get_dirs_from_path()
dir_count = get_file_count_for_dir_list(path_dirs)
print_sorted_dictionary(dir_count)