bug-bash
[Top][All Lists]
Advanced

[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 11:47:13 -0600



On Tue, Nov 3, 2015 at 10:29 AM, <address@hidden> 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.

reply via email to

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