This commit is contained in:
Your Name
2026-05-26 18:43:27 +02:00
parent 7c24a1e1d1
commit 04c006937c
2 changed files with 89 additions and 0 deletions
Executable
+19
View File
@@ -0,0 +1,19 @@
#!/bin/bash
if [ "$#" -ne 2 ]; then
echo "Usage: $0 <file> <column_number>"
exit 1
fi
file="$1"
col="$2"
awk -v c="$col" '
{
if ($c ~ /^-?[0-9]+([.][0-9]+)?$/)
sum += $c
}
END {
print sum
}
' "$file"