<commit_before>#!/bin/sh

set -f

FILE=$1
Mountpoint=
DBFile=
Storage=
MountArgs=
DiffType=File
OutFile=$(mktemp -t elektraenv.XXXXXXXXX 2>/dev/null || mktemp -t 'elektraenv')

RETCMP=
ERRORSCMP=
WARNINGSCMP=
STDOUTCMP=
STDOUTRECMP=
STDOUTGLOBCMP=
STDERRCMP=
DIFFCMP=

BACKUP=0
TMPFILE=$(mktemp -t elektraenv.XXXXXXXXX 2>/dev/null || mktemp -t 'elektraenv')

# variables to count up errors and tests
nbError=0
nbTest=0

if [ -z "@USE_CMAKE_KDB_COMMAND@" ]; then
	KDBCOMMAND="@KDB_COMMAND@"
	export PATH="`dirname \"$KDBCOMMAND\"`:/$PATH"
else
	KDBCOMMAND="kdb"
fi

replace_newline_return () {
	awk -v RS="" '{gsub (/\n/,"⏎")}1'
}

execute()
{
	proto="$*"
	if [ -z "$Mountpoint" ];
	then
	echo "Error: no mountpoint specified in script"
	exit 1
	fi
	if [ -z "$DBFile" ];
	then
	DBFile=$("$KDBCOMMAND" file "$Mountpoint" 2>/dev/null)
	fi

	if [ "$BACKUP" -eq "1" ];
	then
	"$KDBCOMMAND" export "$Mountpoint" dump > "$TMPFILE" 2>/dev/null
	if [ "$?" -ne 0 ];
	then
		echo "ERROR: Failed to backup $Mountpoint\nStopping testcase."
		exit 1<commit_msg>Shell Recorder: Remove unneeded slash from export<commit_after>#!/bin/sh

set -f

FILE=$1
Mountpoint=
DBFile=
Storage=
MountArgs=
DiffType=File
OutFile=$(mktemp -t elektraenv.XXXXXXXXX 2>/dev/null || mktemp -t 'elektraenv')

RETCMP=
ERRORSCMP=
WARNINGSCMP=
STDOUTCMP=
STDOUTRECMP=
STDOUTGLOBCMP=
STDERRCMP=
DIFFCMP=

BACKUP=0
TMPFILE=$(mktemp -t elektraenv.XXXXXXXXX 2>/dev/null || mktemp -t 'elektraenv')

# variables to count up errors and tests
nbError=0
nbTest=0

if [ -z "@USE_CMAKE_KDB_COMMAND@" ]; then
	KDBCOMMAND="@KDB_COMMAND@"
	export PATH="`dirname \"$KDBCOMMAND\"`:$PATH"
else
	KDBCOMMAND="kdb"
fi

replace_newline_return () {
	awk -v RS="" '{gsub (/\n/,"⏎")}1'
}

execute()
{
	proto="$*"
	if [ -z "$Mountpoint" ];
	then
	echo "Error: no mountpoint specified in script"
	exit 1
	fi
	if [ -z "$DBFile" ];
	then
	DBFile=$("$KDBCOMMAND" file "$Mountpoint" 2>/dev/null)
	fi

	if [ "$BACKUP" -eq "1" ];
	then
	"$KDBCOMMAND" export "$Mountpoint" dump > "$TMPFILE" 2>/dev/null
	if [ "$?" -ne 0 ];
	then
		echo "ERROR: Failed to backup $Mountpoint\nStopping testcase."
		exit 1
{'fraction_non_alphanumeric': 0.16815406294034757, 'fraction_numerical': 0.012212306247064349, 'mean_word_length': 4.575916230366492, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 4, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6878944', 'n_tokens_mistral': 936, 'n_tokens_neox': 910, 'n_words': 219}