Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.debian.user > #262540

can you parse and "tail" at once? (and if you can't why not?)

From Albretch Mueller <lbrtchx@gmail.com>
Newsgroups linux.debian.user
Subject can you parse and "tail" at once? (and if you can't why not?)
Date 2023-10-22 18:40 +0200
Message-ID <HrJEB-5ma-7@gated-at.bofh.it> (permalink)
Organization linux.* mail to news gateway

Show all headers | View raw


 After generating a file with lines of text, I have to:
 1) parse some of those lines based on a pattern I know (no regex
necessary, just a FS path)
 2) once parsed from those lines I need the last n characters only
 I am trying to use a one liner like:
 cat "${IFL}" | grep "${DESC_DIR}" | tail -c+$_DESC_DIR
 but this one liner repeats the output and the tail

 Say the lines of text in IFL are:
[info] 123XYZ: /media/user/1234qwer/Algebraic_Geometry04/20231022040239/Uppsala_Algebra/45_16.3_45MEB5h5H9Y.description
[info] 123XYZ: /media/user/1234qwer/Algebraic_Geometry04/20231022040239/Uppsala_Algebra/46_17.1_LE_gl5RcDnY.description
[info] 123XYZ: /media/user/1234qwer/Algebraic_Geometry04/20231022040239/Göttsche/17_9jKzwoBGFs8.description
[info] 123XYZ: /media/user/1234qwer/Algebraic_Geometry04/20231022040239/Göttsche/18_plOUIOo91lI.description
[info] 123XYZ: /media/user/1234qwer/Algebraic_Geometry04/20231022040239/Göttsche/19_TJ7yAiq8gEw.description
[info] 123XYZ: /media/user/1234qwer/Algebraic_Geometry04/20231022040239/Göttsche/20_UMBEgb14uqw.description

 I know the prefix:
[info] 123XYZ: /media/user/1234qwer/Algebraic_Geometry04/20231022040239/

 I need as output:

Uppsala_Algebra/45_16.3_45MEB5h5H9Y
Uppsala_Algebra/46_17.1_LE_gl5RcDnY
Göttsche/17_9jKzwoBGFs8
Göttsche/18_plOUIOo91lI
Göttsche/19_TJ7yAiq8gEw
Göttsche/20_UMBEgb14uqw
~
 lbrtchx

Back to linux.debian.user | Previous | Next — Next in thread | Find similar | Unroll thread


Thread

can you parse and "tail" at once? (and if you can't why not?) Albretch Mueller <lbrtchx@gmail.com> - 2023-10-22 18:40 +0200
  Re: can you parse and "tail" at once? (and if you can't why not?) Charles Curley <charlescurley@charlescurley.com> - 2023-10-22 19:10 +0200
    Re: can you parse and "tail" at once? (and if you can't why not?) Greg Wooledge <greg@wooledge.org> - 2023-10-22 19:50 +0200
      Re: can you parse and "tail" at once? (and if you can't why not?) Albretch Mueller <lbrtchx@gmail.com> - 2023-10-22 23:00 +0200
        Re: can you parse and "tail" at once? (and if you can't why not?) Andy Smith <andy@strugglers.net> - 2023-10-22 23:20 +0200
          Re: can you parse and "tail" at once? (and if you can't why not?) gene heskett <gheskett@shentel.net> - 2023-10-23 00:30 +0200
            Re: can you parse and "tail" at once? (and if you can't why not?) Albretch Mueller <lbrtchx@gmail.com> - 2023-10-23 03:40 +0200
              Re: can you parse and "tail" at once? (and if you can't why not?) Greg Wooledge <greg@wooledge.org> - 2023-10-23 04:20 +0200
                Re: can you parse and "tail" at once? (and if you can't why not?) <tomas@tuxteam.de> - 2023-10-23 06:50 +0200
                Shell-script variable name case [WAS: Re: can you parse and "tail" at  once? (and if you can't why not?)] David <bouncingcats@gmail.com> - 2023-10-23 16:00 +0200
              Re: can you parse and "tail" at once? (and if you can't why not?) Andy Smith <andy@strugglers.net> - 2023-10-23 22:10 +0200
        Re: can you parse and "tail" at once? (and if you can't why not?) Patrick Wiseman <pwiseman@gmail.com> - 2023-10-23 04:50 +0200
  Re: can you parse and "tail" at once? (and if you can't why not?) Roberto C. Sánchez <roberto@debian.org> - 2023-10-22 19:50 +0200
  Re: can you parse and "tail" at once? (and if you can't why not?) Andy Smith <andy@strugglers.net> - 2023-10-22 20:00 +0200
  Re: can you parse and "tail" at once? (and if you can't why not?) Pankaj Jangid <pankaj@codeisgreat.org> - 2023-10-23 10:00 +0200
    Re: can you parse and "tail" at once? (and if you can't why not?) Greg Wooledge <greg@wooledge.org> - 2023-10-23 14:20 +0200
      Re: can you parse and "tail" at once? (and if you can't why not?) Albretch Mueller <lbrtchx@gmail.com> - 2023-10-24 00:20 +0200

csiph-web