Fix loop for lists

This commit is contained in:
Cyrille L 2022-04-14 17:00:54 +02:00
parent 9c788b0849
commit d4a13105b4
3 changed files with 3 additions and 12 deletions

View File

@ -1,5 +1,5 @@
Package: egsl Package: egsl
Version: 0.0.22 Version: 0.0.23
Section: custom Section: custom
Priority: optional Priority: optional
Architecture: all Architecture: all

View File

@ -1,5 +1,5 @@
#!/bin/bash #!/bin/bash
# Version: 0.0.22 # Version: 0.0.23
# file: gsl # file: gsl
# Folder: /usr/local/bin # Folder: /usr/local/bin
# By echolib # By echolib
@ -408,14 +408,6 @@ case "$1" in
;; ;;
list|-l) list|-l)
! [[ "$2" ]] \
&& echo "! Set argument: add|-A/remove|-R" \
&& exit
! [[ "$3" ]] \
&& echo "! Set a position number in list (max=$gsl_list_max_posts)" \
&& exit
case "$2" in case "$2" in
add|-A) gsl_listing_process="add" ;; add|-A) gsl_listing_process="add" ;;
remove|-R) gsl_listing_process="remove" ;; remove|-R) gsl_listing_process="remove" ;;

View File

@ -100,7 +100,7 @@ awk -v s="$1" \
# Convert List.Get first/last line item / repeat till no more mark # Convert List.Get first/last line item / repeat till no more mark
#====================================================================== #======================================================================
gsl__make_list() { gsl__make_list() {
unset gsl_found_list gsl_html_uol unset gsl_found_list
if [[ `awk -v m="$gsl_mark_list" \ if [[ `awk -v m="$gsl_mark_list" \
'$1 == m {print $1;exit}' \ '$1 == m {print $1;exit}' \
"$gsl_tmp_post"` ]];then "$gsl_tmp_post"` ]];then
@ -238,7 +238,6 @@ gsl_list_line_i=$(( gsl_list_o - 1))
sed -i "${gsl_list_line_i}r $gsl_HTML_list" "$gsl_tmp_post" sed -i "${gsl_list_line_i}r $gsl_HTML_list" "$gsl_tmp_post"
rm -f "$gsl_HTML_list" # No more needed HTML tmp file list rm -f "$gsl_HTML_list" # No more needed HTML tmp file list
gsl__make_list
} }
#---------------------------------------------------------------------- #----------------------------------------------------------------------