• Re: One page man

    From Allodoxaphobia@21:1/5 to All on Mon Feb 12 16:28:58 2024
    On Mon, 12 Feb 2024 17:21:32 +0100, db wrote:
    I have a script that adds new entries to a bib file.
    When it has done its job, I would like to display
    the first few lines or at least the first page of
    the result. By hand, I would use more (or less)
    and terminate with q at the end of the first page.
    can I do this from a script? If yes, how?

    head -n 10 <file/name/of/interest>

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From D@21:1/5 to All on Mon Feb 12 20:28:03 2024
    Use head.

    Best regards,
    Daniel


    On Mon, 12 Feb 2024, db wrote:

    I have a script that adds new entries to a bib file.
    When it has done its job, I would like to display
    the first few lines or at least the first page of
    the result. By hand, I would use more (or less)
    and terminate with q at the end of the first page.
    can I do this from a script? If yes, how?


    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Fritz Wuehler@21:1/5 to All on Tue Feb 13 03:41:28 2024
    db <dieterhansbr...@gmail.com> [d]:
    I would like to display the first few lines or at
    least the first page of the result.


    If 'sed' is not your cup of tea, try 'awk' instead:

    < your_file.bib awk NR\<11 # display the first 10 records (lines)

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Fritz Wuehler@21:1/5 to All on Tue Feb 13 07:41:54 2024
    db <dieterhansbr...@gmail.com> [d]:
    I would like to display the first few lines or at
    least the first page of the result.


    Or, if you prefer to display the last ten lines try this:

    < your_file.bib sed -e ':0;$q;N;11,$D;b0' # notice it's "11" rather than "10"

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Fritz Wuehler@21:1/5 to All on Tue Feb 13 08:16:49 2024
    db <dieterhansbr...@gmail.com> [d]:
    I would like to display the first few lines or at
    least the first page of the result.

    To display the first ten lines try this (which is a bit shorter
    than the equivalent head command):

    < your_file.bib sed 10q # after printing the first 10 lines, quit

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From D@21:1/5 to Fritz Wuehler on Tue Feb 13 09:58:53 2024
    On Tue, 13 Feb 2024, Fritz Wuehler wrote:

    db <dieterhansbr...@gmail.com> [d]:
    I would like to display the first few lines or at
    least the first page of the result.

    To display the first ten lines try this (which is a bit shorter
    than the equivalent head command):

    < your_file.bib sed 10q # after printing the first 10 lines, quit



    This is art!

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Marc Haber@21:1/5 to All on Wed Feb 14 12:55:46 2024
    Fritz Wuehler <fritz@spamexpire-202402.rodent.frell.theremailer.net>
    wrote:
    db <dieterhansbr...@gmail.com> [d]:
    I would like to display the first few lines or at
    least the first page of the result.


    Or, if you prefer to display the last ten lines try this:

    < your_file.bib sed -e ':0;$q;N;11,$D;b0' # notice it's "11" rather than "10"

    Using tail is not complicated enough?

    --
    ---------------------------------------------------------------------------- Marc Haber | " Questions are the | Mailadresse im Header Rhein-Neckar, DE | Beginning of Wisdom " |
    Nordisch by Nature | Lt. Worf, TNG "Rightful Heir" | Fon: *49 6224 1600402

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Fritz Wuehler@21:1/5 to All on Sun Feb 18 20:51:12 2024
    db <dieterhansbr...@gmail.com> [d]:
    Why didn't I know about this command? And how many others
    are there that I should know?


    Take your own sweet time with some intoductory material, like

    Introduction to the Linux Command Shell For Beginners
    (by Victor Gedris)
    https://www.cgs.iitk.ac.in/user/hk/csd101/2021/shellIntro.pdf

    The Linux Command Handbook - Learn Linux Commands for Beginners
    (by Flavio Copes)
    https://www.freecodecamp.org/news/the-linux-commands-handbook

    and build from there.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)