[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Paste with null delimiter
From: |
Dennis Williamson |
Subject: |
Re: Paste with null delimiter |
Date: |
Tue, 3 Nov 2015 14:09:49 -0600 |
On Nov 3, 2015 12:47 PM, "Julio C. Neves" <julio.neves@gmail.com> wrote:
>
> Thanks Dennis,
> I know that you are rigth, but "paste -d"" odd even" and "paste -d "" odd even" are not the same? The diference is only a space between the option and its parameter.
>
> Abcs,
> Julio
> @juliobash
>
> Próximos cursos de Shell
> Cidade Local Período
> São Paulo 4Linux 07/12 a 11/12
> Dou treinamento de Shell em qualquer cidade.
> Para mais detalhes, me mande um e-mail.
>
>
> 2015-11-03 15:47 GMT-02:00 Dennis Williamson <dennistwilliamson@gmail.com>:
>>
>>
>>
>> On Tue, Nov 3, 2015 at 10:29 AM, <julio.neves@gmail.com> wrote:
>>>
>>> An example is better than thousand words:
>>>
>>> $ seq 1 2 9 > odd
>>> $ seq 2 2 10 > even
>>> $ paste -d "" odd even
>>> 12
>>> 34
>>> 56
>>> 78
>>> 910
>>> $ paste -d"" odd even
>>> 2
>>> 4
>>> 6
>>> 8
>>> 10
>>>
>>> Like you can see, with no space between the option (-d) and the null parameter (""), we have an unexpected result
>>
>>
>>
>> This isn't a bash bug so this isn't the proper place for your question.
>>
>> However, what is happening is that the shell evaluates the -d"", removing the quotes and resulting in -d followed by nothing (so it's the same as if you had typed -d by itself.
>>
>> As a result, the delimiter becomes the first character of "odd" and only one file (even) is pasted.
>>
>> So
>>
>> paste -d"" odd even
>>
>> is the same as
>>
>> paste even
>>
>> Try this for comparison:
>>
>> paste -d"" odd even even
>>
>> --
>> Visit serverfault.com to get your system administration questions answered.
>
>
No, they're different. I and others have explained how.
Re: Paste with null delimiter, Dennis Williamson, 2015/11/03
Re: Paste with null delimiter, Andreas Schwab, 2015/11/03
Re: Paste with null delimiter, Stephane Chazelas, 2015/11/04