#!/bin/sh
#] 
#] *********************
#] $ bash "$d_bin"'paragraph rm chr_newLine.sh' - just a mish-mash dummy file with general format for bash scripts
# www.BillHowell.ca  15Jan2023 initial 
# view in text editor, using constant-width font (eg courier), tabWidth = 3


#************************
# List of operators, generated with :
# $ grep  "^#]"  "$d_bin"'paragraph rm chr_newLine.sh' |  sed "s/^#\]/  /" 

#

# 15Jan2023 put this in fileops.sh when working!!!!


#************************
# Setup 

source  "$d_bin""standard header.sh"



#************
# code 

# 15Jan2023 problem with nested whiles? or geany peculiarity?

paragraph_rm_chrNewLine()
{  
pinn="$1"
pout="$2"
in_para=0
line=""
rm "$pout"
while read -u 9 line; do 
	chr1=$( sed  's|||' )
	if [  "$in_para"  ]; then 
		if	[[  '['  ==  "$chr1"  ]]; then
			in_para=1
			para=
			while read  -u  9 line; do 
				if    [  '[' == "$line" ]; then
					echo  "$line"  >>"$pout"
					in_para=0
				elif  [  '' == "$line" ]; then
					echo  "$line"  >>"$pout"
					in_para=0
				fi
			done
		else	echo  "$line"  >>"$pout"
			line=""
		fi
	else
	
	fi
done  9<"$pinn"
}  


#*******************************************************************************
# Procedures -  To run :



#************
# run - select one of options

# paragraph_rm_chrNewLine "$d_PROJECTS"'My Reviews/NEUNET-D-23-00010 r Konga, Quanxin, Karimic - Fixed-time periodic stabilization of discontinuous reaction-diffusion Cohen-Grossberg NNs.txt'  "$d_PROJECTS"'My Reviews/NEUNET-D-23-00010 r Konga, Quanxin, Karimic - Fixed-time periodic stabilization of discontinuous reaction-diffusion Cohen-Grossberg NNs paragraph_rm_chrNewLine.txt'



# $ bash  "$d_bin"'paragraph rm chr_newLine.sh'  


# enddoc
