Orestes leal wrote:
> On Wed, 20 Jun 2007 16:29:12 +0200
> Michelle Konzack <[EMAIL PROTECTED]> wrote:
> 
>> Am 2007-06-14 19:00:47, schrieb Orestes leal:
>>>     $fdisk -l | grep dev | gawk -F' *' '{ print $1 }' | gawk -F'/dev/' '{ 
>>> print $0 }' | grep '/dev/sd' > particiones.txt
>> 

<<Stripped>>

>>
>>     echo -e "${FDISKOUT}" | some_command ...
>>          ^^
>>     Do not forget it.  :-)

Why is '-e' required?  The -e tells 'echo' to "-e enable interpretation of 
backslash escapes", but there are no backslash escapes in the output of the 
'fdisk -l' to worry about.

What's important is that you have the double quotes around the variable 
expansion, which preserves all white space characters 'as is' (or if you 
prefer, as they were in the original fdisk output - tabs, spaces and newlines). 
 The entire content of the variable is passed to echo as a single (very large;) 
argument with embedded white space characters intact.

Without the double quotes, echo sees multiple arguments.  The arguments were 
created by the shell, using the white space separators to break them up.  echo 
never sees any white space, so it it prints each argument separated from the 
next by a single space, which puts everything together into one long, 
unformatted string.

> 
> Thanks.
>> Thanks, Greetings and nice Day
> 
> Ore.
> 
> Orestes <[EMAIL PROTECTED]>
> 

-- 
Bob McGowan


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED] 
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to