Little bash Functions contains the following functions:
Little bash Functions contains the 9 following functions:
show_time_fun
show_time_fun
test_tab_in_file_fun
test_tab_in_file_fun
test_space_in_file_fun
test_space_in_file_fun
...
@@ -12,12 +13,33 @@ var_existence_check_fun
...
@@ -12,12 +13,33 @@ var_existence_check_fun
file_exten_verif_name_recov_fun
file_exten_verif_name_recov_fun
#### LICENCE
This package of scripts can be redistributed and/or modified under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
Distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the GNU General Public License for more details at https://www.gnu.org/licenses.
#### CREDITS
Gael A. Millot, Hub-C3BI, Institut Pasteur, USR 3756 IP CNRS, Paris, France
#### HOW TO USE IT
#### HOW TO USE IT
Download the desired Tagged version, never the current master.
Download the desired Tagged version, never the current master.
Source the little_bash_functions.sh to have the functions available in the working environment.
@@ -430,10 +430,16 @@ function single_path_with_regex_fun {
...
@@ -430,10 +430,16 @@ function single_path_with_regex_fun {
return 2
return 2
else
else
shopt-s extglob # -s unable global extention, ie the recognition of special global pattern in path, like [[:digit:]]
shopt-s extglob # -s unable global extention, ie the recognition of special global pattern in path, like [[:digit:]]
if[[!(-d${ARG1_ARR[0]}||-f${ARG1_ARR[0]})]];then
if[[$(echo${ARG1_ARR[0]} | grep-cE'^http')== 1 ]];then# -cE to specify extended and -c to return the number of match (here 0 or one only)
if[[$(wget ${ARG1_ARR[0]}>/dev/null 2>&1 ;echo$?)!= 0 ]];then# check the valid url. wget $url >/dev/null 2>&1 prevent any action and print. echo $? print the result of the last command (0 = success, other number = failure)
echo-e"\n### ERROR ### SPECIFIED URL IN single_path_with_regex_fun DOES NOT EXISTS: ${ARG1_ARR[0]}\n";
shopt-u extglob # -u disable global extention, ie the recognition of special global pattern in path, like [[:digit:]]