Start translating to ysh.

This commit is contained in:
Abdulkadir Furkan Şanlı
2023-12-09 00:43:51 +01:00
parent be2fd77729
commit 594ee32182
40 changed files with 1086 additions and 2 deletions

View File

@@ -1,26 +0,0 @@
#!/usr/bin/env bash
set -o errexit
set -o nounset
set -o pipefail
if [[ "${TRACE-0}" == "1" ]]; then
set -o xtrace
fi
cd "$(dirname "$0")"
main ()
{
declare -a components
declare -i result=0
while read -r line; do
mapfile -t matches <<< "$(grep -o '[[:digit:]]' <<< "${line}")"
components+=("${matches[0]}${matches[-1]}")
done < input.txt
for value in "${components[@]}"; do
(( result += value ))
done
echo "${result}"
}
main