Page 1 of 2 12 LastLast
Results 1 to 10 of 12

Thread: shell problem "tail"

  1. #1
    Join Date
    Nov 2010
    Location
    denmark
    Posts
    88

    Default shell problem "tail"

    hi i am working my way through these document "SUSE-Linux-Toolbox-1000-Commands-for-openSUSE-and-SUSE-Linux-Enterprise.pdf"
    and haw com to chapter 3 using shell. i the using of the "tail" command i came a pond these problem whit reading a document ind the "odt styles". haw do i change the "styles" so i can reed my document.


    ":~> tail -f /home/hik/Dokumenter/hik.odt
    styles.xml�Zݏ�6���PѾɒ�uv��ӇE�Kz�%w�-��Hj��_�/��%��]��Y �9Ù�o����??���sA"

  2. #2
    Join Date
    Jun 2008
    Location
    Earth - Denmark
    Posts
    10,730

    Default Re: shell problem "tail"

    On 02/15/2012 06:36 PM, hhbuur wrote:
    >
    > problem whit reading a document ind the "odt
    > styles". haw do i change the "styles" so i can reed my document.


    tail is a command which reads out to the console exactly what it 'sees'
    in the specified file whether if it is a log file in pure ascii text or
    something other..

    and, .odt files (and other Libre/OpenOffice files) will invariably not
    be pure ascii text and is there unsuitable for use with tail....unless
    of course you really want to see what is inside..

    try it on a plain text file, or to cut off the beginning of a LONG
    terminal output, like say compare the output of these two commands:
    Code:
    dmesg | tail
    dmesg
    if you _knew_ what you were wanting to see fell at the end, it is so
    much quicker to just push that out..

    --
    DD http://tinyurl.com/SUSEonDW

  3. #3
    Join Date
    Jun 2008
    Location
    Podunk
    Posts
    26,299
    Blog Entries
    15

    Default Re: shell problem "tail"

    Hi
    I would guess it's the file encoding. What does the beginning of the file indicate the encoding is, ISO or UTF?

    What it your environment set to?
    Code:
    locale
    You might have to use the iconv command to change it.
    Cheers Malcolm °¿° SUSE Knowledge Partner (Linux Counter #276890)
    SUSE SLE, openSUSE Leap/Tumbleweed (x86_64) | GNOME DE
    If you find this post helpful and are logged into the web interface,
    please show your appreciation and click on the star below... Thanks!

  4. #4
    Join Date
    Feb 2010
    Location
    Germany
    Posts
    4,654

    Default Re: shell problem "tail"

    An odt file is essentially a zip file which contains several xml files.
    In principle you can show the content with the unzip command and piping
    that into your tail command.

    Code:
    unzip -c my_odt_file.odt content.xml | tail
    content.xml is what contains the main text of the odt if I recall correctly.

    --
    PC: oS 11.4 (dual boot 12.1) 64 bit | Intel Core i7-2600@3.40GHz | KDE
    4.6.0 | GeForce GT 420 | 16GB Ram
    Eee PC 1201n: oS 11.4 64 bit | Intel Atom 330@1.60GHz | KDE 4.8.0 |
    nVidia ION | 3GB Ram

  5. #5
    Join Date
    Feb 2010
    Location
    Germany
    Posts
    4,654

    Default Re: shell problem "tail"

    Am 15.02.2012 19:18, schrieb Martin Helm:
    > An odt file is essentially a zip file which contains several xml files.
    > In principle you can show the content with the unzip command and piping
    > that into your tail command.
    >
    >
    Code:
    > unzip -c my_odt_file.odt content.xml | tail
    >
    > content.xml is what contains the main text of the odt if I recall correctly.
    >

    You will get a slightly better result if you pipe the xml through a
    pretty printer (the xml command from the package xmlstarlet can do this)
    Code:
    cd /usr/share/gutenprint/doc/
    unzip -p gutenprint-users-manual.odt content.xml | xml fo - | tail
    results in
    Code:
    <text:p text:style-name="Text_20_body">
    <text:span text:style-name="Strong_20_Emphasis">10. FUTURE
    REVISIONS OF THIS LICENSE</text:span>
    </text:p>
    <text:p text:style-name="Text_20_body">The Free Software
    Foundation may publish new, revised versions of the GNU Free
    Documentation License from time to time. Such new versions will be
    similar in spirit to the present version, but may differ in detail to
    address new problems or concerns. See http://www.gnu.org/copyleft/.
    </text:p>
    <text:p text:style-name="Text_20_body">Each version of the License
    is given a distinguishing version number. If the Document specifies that
    a particular numbered version of this License "or any later version"
    applies to it, you have the option of following the terms and conditions
    either of that specified version or of any later version that has been
    published (not as a draft) by the Free Software Foundation. If the
    Document does not specify a version number of this License, you may
    choose any version ever published (not as a draft) by the Free Software
    Foundation. </text:p>
    <text:p text:style-name="Text_20_body"/>
    <text:p text:style-name="Text_20_body"/>
    </office:text>
    </office:body>
    </office:document-content>
    --
    PC: oS 11.4 (dual boot 12.1) 64 bit | Intel Core i7-2600@3.40GHz | KDE
    4.6.0 | GeForce GT 420 | 16GB Ram
    Eee PC 1201n: oS 11.4 64 bit | Intel Atom 330@1.60GHz | KDE 4.8.0 |
    nVidia ION | 3GB Ram

  6. #6
    Join Date
    Jun 2008
    Location
    Earth - Denmark
    Posts
    10,730

    Default Re: shell problem "tail"

    On 02/15/2012 07:18 PM, Martin Helm wrote:

    > unzip -c my_odt_file.odt content.xml | tail



    kewl!! love learning from you (and the other smart folks here)

    --
    DD http://tinyurl.com/SUSEonDW

  7. #7
    Join Date
    Feb 2010
    Location
    Germany
    Posts
    4,654

    Default Re: shell problem "tail"

    Am 15.02.2012 21:15, schrieb DenverD:
    > On 02/15/2012 07:18 PM, Martin Helm wrote:
    >
    >> unzip -c my_odt_file.odt content.xml | tail

    >
    >
    > kewl!! love learning from you (and the other smart folks here)
    >

    To be honest most people will not really be interested to see the
    content as xml and are better served to install odt2txt which turns the
    odt file into a plain text file.
    For example (it will take a moment when the command converts the content)
    Code:
    odt2txt gutenprint-users-manual.odt | head -n 20
    
    ,
    
    Gutenprint 5.2
    
    User's Manual
    
    Robert Krawitz
    
    October 18, 2008
    
    Gutenprint 5.2 User's Manual
    
    Copyright © 2000-2008 Robert Krawitz
    
    Permission is granted to copy, distribute and/or modify this
    document under the terms of the GNU Free Documentation License,
    Version 1.2 or any later version published by the Free Software
    Foundation with no invariant sections, no Front-Cover texts,
    and no Back-Cover texts.
    --
    PC: oS 11.4 (dual boot 12.1) 64 bit | Intel Core i7-2600@3.40GHz | KDE
    4.6.0 | GeForce GT 420 | 16GB Ram
    Eee PC 1201n: oS 11.4 64 bit | Intel Atom 330@1.60GHz | KDE 4.8.0 |
    nVidia ION | 3GB Ram
    Last edited by Knurpht; 15-Feb-2012 at 15:13.

  8. #8
    Join Date
    Feb 2010
    Location
    Germany
    Posts
    4,654

    Default AW: Re: shell problem "tail"

    I managed to cripple the code tags - sorry.

  9. #9
    Join Date
    Jun 2008
    Location
    Groningen, Netherlands
    Posts
    19,583
    Blog Entries
    14

    Default Re: AW: Re: shell problem "tail"

    Quote Originally Posted by martin_helm View Post
    I managed to cripple the code tags - sorry.
    No problem, Martin, fixed.
    ° Appreciate my reply? Click the star and let me know why.

    ° Perfection is not gonna happen. No way.

    https://en.opensuse.org/openSUSE:Board#Members
    http://en.opensuse.org/User:Knurpht
    http://nl.opensuse.org/Gebruiker:Knurpht

  10. #10
    Join Date
    Feb 2010
    Location
    Germany
    Posts
    4,654

    Default AW: Re: AW: Re: shell problem "tail"

    Quote Originally Posted by Knurpht View Post
    No problem, Martin, fixed.
    Great, thank you.

Page 1 of 2 12 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •