# [PATCH] Fix tail option problem in test

4 messages from 2007-04-23 to 2007-04-24. Participants: A Large Angry SCM, Junio C Hamano.
Thread: https://gitlist.dev/t/7809

## A Large Angry SCM, 2007-04-23 23:56

Subject: [PATCH] Fix tail option problem in test
Message-ID: <462D47CA.7010806@gmail.com>
URL: https://gitlist.dev/e/462D47CA.7010806%40gmail.com

```
The tail command on my system complains:

	tail: cannot open `8192' for reading: No such file or directory

if there is any whitespace between the '-c' option and the byte count.

Signed-off-by: A Large Angry SCM <Gitzilla@gmail.com>
---

 t/t5302-pack-index.sh |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/t/t5302-pack-index.sh b/t/t5302-pack-index.sh
index 232e5f1..b7870a8 100755
--- a/t/t5302-pack-index.sh
+++ b/t/t5302-pack-index.sh
@@ -16,7 +16,7 @@ test_expect_success \
          test-genrandom "$i" 8192 >>file_$i &&
          git-update-index --add file_$i || return 1
      done &&
-     echo 101 >file_101 && tail -c 8192 file_100 >>file_101 &&
+     echo 101 >file_101 && tail -c8192 file_100 >>file_101 &&
      git-update-index --add file_101 &&
      tree=`git-write-tree` &&
      commit=`git-commit-tree $tree </dev/null` && {

```

## Junio C Hamano, 2007-04-24 00:09

Subject: Re: [PATCH] Fix tail option problem in test
Message-ID: <7v4pn6d459.fsf@assigned-by-dhcp.cox.net>
URL: https://gitlist.dev/e/7v4pn6d459.fsf%40assigned-by-dhcp.cox.net
In-Reply-To: <462D47CA.7010806@gmail.com>

```
A Large Angry SCM <gitzilla@gmail.com> writes:

> The tail command on my system complains:
>
> 	tail: cannot open `8192' for reading: No such file or directory
>
> if there is any whitespace between the '-c' option and the byte count.
>
> Signed-off-by: A Large Angry SCM <Gitzilla@gmail.com>
> ---
>
>  t/t5302-pack-index.sh |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/t/t5302-pack-index.sh b/t/t5302-pack-index.sh
> index 232e5f1..b7870a8 100755
> --- a/t/t5302-pack-index.sh
> +++ b/t/t5302-pack-index.sh
> @@ -16,7 +16,7 @@ test_expect_success \
>           test-genrandom "$i" 8192 >>file_$i &&
>           git-update-index --add file_$i || return 1
>       done &&
> -     echo 101 >file_101 && tail -c 8192 file_100 >>file_101 &&
> +     echo 101 >file_101 && tail -c8192 file_100 >>file_101 &&
>       git-update-index --add file_101 &&
>       tree=`git-write-tree` &&
>       commit=`git-commit-tree $tree </dev/null` && {

I do not like using tail to do a byte-oriented thing like this
to begin with.  How about using the plain old trustworthy and
portable program, "dd", instead?

```

## A Large Angry SCM, 2007-04-24 00:29

Subject: Re: [PATCH] Fix tail option problem in test
Message-ID: <462D4F5D.7010605@gmail.com>
URL: https://gitlist.dev/e/462D4F5D.7010605%40gmail.com
In-Reply-To: <7v4pn6d459.fsf@assigned-by-dhcp.cox.net>

```
Junio C Hamano wrote:
> A Large Angry SCM <gitzilla@gmail.com> writes:
> 
>> The tail command on my system complains:
>>
>> 	tail: cannot open `8192' for reading: No such file or directory
>>
>> if there is any whitespace between the '-c' option and the byte count.
>>
>> Signed-off-by: A Large Angry SCM <Gitzilla@gmail.com>
>> ---
>>
>>  t/t5302-pack-index.sh |    2 +-
>>  1 files changed, 1 insertions(+), 1 deletions(-)
>>
>> diff --git a/t/t5302-pack-index.sh b/t/t5302-pack-index.sh
>> index 232e5f1..b7870a8 100755
>> --- a/t/t5302-pack-index.sh
>> +++ b/t/t5302-pack-index.sh
>> @@ -16,7 +16,7 @@ test_expect_success \
>>           test-genrandom "$i" 8192 >>file_$i &&
>>           git-update-index --add file_$i || return 1
>>       done &&
>> -     echo 101 >file_101 && tail -c 8192 file_100 >>file_101 &&
>> +     echo 101 >file_101 && tail -c8192 file_100 >>file_101 &&
>>       git-update-index --add file_101 &&
>>       tree=`git-write-tree` &&
>>       commit=`git-commit-tree $tree </dev/null` && {
> 
> I do not like using tail to do a byte-oriented thing like this
> to begin with.  How about using the plain old trustworthy and
> portable program, "dd", instead?

It's not as easy to get the last X bytes of a file with dd.

```

## Junio C Hamano, 2007-04-24 05:02

Subject: Re: [PATCH] Fix tail option problem in test
Message-ID: <7v8xcibc00.fsf@assigned-by-dhcp.cox.net>
URL: https://gitlist.dev/e/7v8xcibc00.fsf%40assigned-by-dhcp.cox.net
In-Reply-To: <462D4F5D.7010605@gmail.com>

```
A Large Angry SCM <gitzilla@gmail.com> writes:

> It's not as easy to get the last X bytes of a file with dd.

Fair enough.

```
