[wellylug] simple super basic bash question
Mark Signal
mark at databackup.co.nz
Tue Dec 21 07:42:45 NZDT 2004
I had never heard of paste
if I try your syntax I get bash: syntax error near unexpected token `<f'
this seems to work fine however
[root at wevil root]# paste -d " " file1 file2
hello goodbye
thanks for responding
I have learnt a VAST amount from this list.
cheers
Mark
Brent Wood wrote:
>--- Geraint Jones <g.jones at french-maid.co.nz> wrote:
>
>
>
>> echo `cat file1` `cat file2` > file3
>>
>>
>
>OK if file1 & file2 only have one line in each. Otherwise try
>
> paste -d " " <file1> <file2>
>
>
>paste writes corresponding lines from file1 & file2 to stdout, separated by a
>tab. The -d option allows you to specify the delimiter to use, in the example
>above, use a space instead of a tab.
>
>Cheers,
>
> Brent
>
>
>
>>________________________________
>>
>>From: wellylug-admin at lists.wellylug.org.nz on behalf of Mark Signal
>>Sent: Mon 20/12/2004 9:53 PM
>>To: Wellylug
>>Subject: [wellylug] simple super basic bash question
>>
>>
>>
>>if file1 contains "hello" and file2 contains "goodbye" and I 'cat
>>file1 file2 > file3' then
>>file3 contains 2 lines:
>>hello
>>goodbye
>>
>>how do I do this so that file3 contains the contents of file1 and file2
>>on one line:
>>hello goodbye
>>
>>
>>
>
>
>
>
More information about the wellylug
mailing list