Le site arthur.bebou.netlib.re - retour accueil
git clone git://bebou.netlib.re/arthur.bebou
Log | Files | Refs |
commit e5db126a4adef903adebf9632763f26ec62ffa13 parent 52baa94905614b48346b5d0e195e0d2dd87f147a Auteurice: Arthur Pons <arthur.pons@unistra.fr> Date: Fri, 25 Apr 2025 15:46:49 +0200 Correction bug fonction tsv2layout Le tee semblait poser problème, il n'écrivait pas la totalité de stdin dans le fichier all. Faire un cat puis continuer ensuite semble corriger le problème. Diffstat:
M | common | | | 14 | +++++++------- |
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/common b/common @@ -3,16 +3,16 @@ tmpd=$(mktemp -d) trap "rm -rf $tmpd" EXIT -show() lowdown --html-no-skiphtml --html-no-escapehtml $tmpd/$1 +show() { lowdown --html-no-skiphtml --html-no-escapehtml $tmpd/$1; } tsv2layout() { - tee $tmpd/all | - head -n1 | tr '\t' '\n' > $tmpd/vars - tail -n+2 $tmpd/all | - while read line;do - eval $(echo "$line" | tr ' ' '\n' | paste -d '=' $tmpd/vars - | + cat > $tmpd/all + < $tmpd/all head -n1 | tr '\t' '\n' > $tmpd/vars + < $tmpd/all tail -n+2 | + while IFS= read line;do + eval $(echo "$line" | tr '\t' '\n' | paste -d '=' $tmpd/vars - | sed -E 's/"/\\\"/g' | sed -E 's/=/&"/;s/$/"/') - . ./"$1" + . "./$1" done }