bison-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: tests: factor the generation of files without the final eol


From: Paul Eggert
Subject: Re: tests: factor the generation of files without the final eol
Date: Sun, 13 Oct 2019 20:44:20 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.9.0

A more portable way to do that would be to use 'dd', e.g., something like the following where 'file' contains name of the file to be trimmed:

set x $(LC_ALL=C ls -l "$file") &&
size=$6 &&
{ test $size -eq 0 ||
  dd obs=1 seek=$(($size - 1)) if=/dev/null of="$file"; }



reply via email to

[Prev in Thread] Current Thread [Next in Thread]