Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.c > #136032 > unrolled thread
| Started by | jacobnavia <jacob@jacob.remcomp.fr> |
|---|---|
| First post | 2018-10-02 22:37 +0200 |
| Last post | 2018-12-17 15:18 +0000 |
| Articles | 20 on this page of 211 — 33 participants |
Back to article view | Back to comp.lang.c
Counting lines of a file jacobnavia <jacob@jacob.remcomp.fr> - 2018-10-02 22:37 +0200
Re: Counting lines of a file Lew Pitcher <lew.pitcher@digitalfreehold.ca> - 2018-10-02 16:45 -0400
Re: Counting lines of a file Ian Collins <ian-news@hotmail.com> - 2018-10-03 09:51 +1300
Re: Counting lines of a file jacobnavia <jacob@jacob.remcomp.fr> - 2018-10-02 22:55 +0200
Re: Counting lines of a file Keith Thompson <kst-u@mib.org> - 2018-10-02 14:31 -0700
Re: Counting lines of a file jacobnavia <jacob@jacob.remcomp.fr> - 2018-10-02 23:39 +0200
Re: Counting lines of a file Keith Thompson <kst-u@mib.org> - 2018-10-02 16:39 -0700
Re: Counting lines of a file jacobnavia <jacob@jacob.remcomp.fr> - 2018-10-03 08:49 +0200
Re: Counting lines of a file Keith Thompson <kst-u@mib.org> - 2018-10-03 11:46 -0700
Re: Counting lines of a file scott@slp53.sl.home (Scott Lurndal) - 2018-10-02 21:04 +0000
Re: Counting lines of a file dave_thompson_2@comcast.net - 2018-12-14 17:52 -0500
Re: Counting lines of a file Jorgen Grahn <grahn+nntp@snipabacken.se> - 2018-12-15 08:14 +0000
Re: Counting lines of a file Nick Bowler <nbowler@draconx.ca> - 2018-10-02 21:24 +0000
Re: Counting lines of a file jacobnavia <jacob@jacob.remcomp.fr> - 2018-10-02 23:32 +0200
Re: Counting lines of a file queequeg@trust.no1 (Queequeg) - 2018-10-03 10:44 +0000
Re: Counting lines of a file jacobnavia <jacob@jacob.remcomp.fr> - 2018-10-03 13:17 +0200
Re: Counting lines of a file David Brown <david.brown@hesbynett.no> - 2018-10-03 14:35 +0200
Re: Counting lines of a file Keith Thompson <kst-u@mib.org> - 2018-10-02 14:25 -0700
Re: Counting lines of a file jacobnavia <jacob@jacob.remcomp.fr> - 2018-10-02 22:54 +0200
Re: Counting lines of a file jacobnavia <jacob@jacob.remcomp.fr> - 2018-10-02 23:43 +0200
Re: Counting lines of a file Andreas Perstinger <andipersti@gmail.com> - 2018-10-05 11:35 +0000
Re: Counting lines of a file Nick Bowler <nbowler@draconx.ca> - 2018-10-02 20:56 +0000
Re: Counting lines of a file jacobnavia <jacob@jacob.remcomp.fr> - 2018-10-02 23:00 +0200
Re: Counting lines of a file Nick Bowler <nbowler@draconx.ca> - 2018-10-02 21:13 +0000
Re: Counting lines of a file jacobnavia <jacob@jacob.remcomp.fr> - 2018-10-02 23:28 +0200
Re: Counting lines of a file queequeg@trust.no1 (Queequeg) - 2018-10-03 10:48 +0000
Re: Counting lines of a file Bart <bc@freeuk.com> - 2018-10-03 12:07 +0100
Re: Counting lines of a file David Brown <david.brown@hesbynett.no> - 2018-10-03 14:49 +0200
Re: Counting lines of a file Bart <bc@freeuk.com> - 2018-10-03 14:25 +0100
Re: Counting lines of a file David Brown <david.brown@hesbynett.no> - 2018-10-03 16:05 +0200
Re: Counting lines of a file scott@slp53.sl.home (Scott Lurndal) - 2018-10-03 14:17 +0000
Re: Counting lines of a file Bart <bc@freeuk.com> - 2018-10-03 16:53 +0100
Re: Counting lines of a file scott@slp53.sl.home (Scott Lurndal) - 2018-10-03 16:07 +0000
Re: Counting lines of a file David Brown <david.brown@hesbynett.no> - 2018-10-04 15:12 +0200
Re: Counting lines of a file Keith Thompson <kst-u@mib.org> - 2018-10-03 11:23 -0700
Re: Counting lines of a file jacobnavia <jacob@jacob.remcomp.fr> - 2018-10-03 20:42 +0200
Re: Counting lines of a file Keith Thompson <kst-u@mib.org> - 2018-10-03 12:03 -0700
Re: Counting lines of a file jacobnavia <jacob@jacob.remcomp.fr> - 2018-10-03 21:45 +0200
Re: Counting lines of a file Ian Collins <ian-news@hotmail.com> - 2018-10-04 08:52 +1300
Re: Counting lines of a file Keith Thompson <kst-u@mib.org> - 2018-10-03 13:26 -0700
Re: Counting lines of a file David Brown <david.brown@hesbynett.no> - 2018-10-04 15:37 +0200
Re: Counting lines of a file Bart <bc@freeuk.com> - 2018-10-04 15:06 +0100
Re: Counting lines of a file David Brown <david.brown@hesbynett.no> - 2018-10-04 21:48 +0200
Re: Counting lines of a file David Brown <david.brown@hesbynett.no> - 2018-10-04 15:28 +0200
Re: Counting lines of a file gazelle@shell.xmission.com (Kenny McCormack) - 2018-10-04 14:16 +0000
Re: Counting lines of a file Keith Thompson <kst-u@mib.org> - 2018-10-04 11:09 -0700
Re: Counting lines of a file David Brown <david.brown@hesbynett.no> - 2018-10-04 22:00 +0200
Re: Counting lines of a file Bart <bc@freeuk.com> - 2018-10-04 21:18 +0100
Re: Counting lines of a file scott@slp53.sl.home (Scott Lurndal) - 2018-10-04 20:28 +0000
Re: Counting lines of a file Bart <bc@freeuk.com> - 2018-10-04 21:59 +0100
Re: Counting lines of a file scott@slp53.sl.home (Scott Lurndal) - 2018-10-04 21:10 +0000
Re: Counting lines of a file Keith Thompson <kst-u@mib.org> - 2018-10-04 15:53 -0700
Re: Counting lines of a file Bart <bc@freeuk.com> - 2018-10-05 00:09 +0100
Re: Counting lines of a file Ben Bacarisse <ben.usenet@bsb.me.uk> - 2018-10-05 02:06 +0100
Re: Counting lines of a file jacobnavia <jacob@jacob.remcomp.fr> - 2018-10-04 22:40 +0200
Re: Counting lines of a file scott@slp53.sl.home (Scott Lurndal) - 2018-10-04 21:13 +0000
Re: Counting lines of a file Ben Bacarisse <ben.usenet@bsb.me.uk> - 2018-10-04 23:09 +0100
Re: Counting lines of a file jacobnavia <jacob@jacob.remcomp.fr> - 2018-10-05 07:47 +0200
Re: Counting lines of a file David Brown <david.brown@hesbynett.no> - 2018-10-05 09:44 +0200
Re: Counting lines of a file jacobnavia <jacob@jacob.remcomp.fr> - 2018-10-05 12:41 +0200
Re: Counting lines of a file David Brown <david.brown@hesbynett.no> - 2018-10-05 16:01 +0200
Re: Counting lines of a file Jorgen Grahn <grahn+nntp@snipabacken.se> - 2018-10-22 13:58 +0000
Re: Counting lines of a file David Brown <david.brown@hesbynett.no> - 2018-10-22 16:44 +0200
Re: Counting lines of a file jadill33@gmail.com - 2018-10-08 09:10 -0700
Re: Counting lines of a file Ben Bacarisse <ben.usenet@bsb.me.uk> - 2018-10-05 13:17 +0100
Re: Counting lines of a file already5chosen@yahoo.com - 2018-10-03 11:34 -0700
Re: Counting lines of a file jacobnavia <jacob@jacob.remcomp.fr> - 2018-10-03 13:14 +0200
Re: Counting lines of a file Ben Bacarisse <ben.usenet@bsb.me.uk> - 2018-10-04 00:59 +0100
Re: Counting lines of a file jacobnavia <jacob@jacob.remcomp.fr> - 2018-10-04 08:57 +0200
Re: Counting lines of a file Ian Collins <ian-news@hotmail.com> - 2018-10-04 20:05 +1300
Re: Counting lines of a file Ben Bacarisse <ben.usenet@bsb.me.uk> - 2018-10-04 10:58 +0100
Re: Counting lines of a file Malcolm McLean <malcolm.arthur.mclean@gmail.com> - 2018-10-04 04:06 -0700
Re: Counting lines of a file Ben Bacarisse <ben.usenet@bsb.me.uk> - 2018-10-04 15:35 +0100
Re: Counting lines of a file Bart <bc@freeuk.com> - 2018-10-04 11:48 +0100
Re: Counting lines of a file Ben Bacarisse <ben.usenet@bsb.me.uk> - 2018-10-04 15:30 +0100
Re: Counting lines of a file queequeg@trust.no1 (Queequeg) - 2018-10-04 21:35 +0000
Re: Counting lines of a file jacobnavia <jacob@jacob.remcomp.fr> - 2018-10-05 07:35 +0200
Re: Counting lines of a file Ike Naar <ike@sdf.lonestar.org> - 2018-10-06 23:56 +0000
Re: Counting lines of a file jacobnavia <jacob@jacob.remcomp.fr> - 2018-10-07 09:13 +0200
Re: Counting lines of a file Ike Naar <ike@iceland.freeshell.org> - 2018-10-11 22:14 +0000
Re: Counting lines of a file Ralf Damaschke <rwspam@gmx.de> - 2018-10-11 23:14 +0000
Re: Counting lines of a file antispam@math.uni.wroc.pl - 2018-12-17 20:17 +0000
Re: Counting lines of a file Keith Thompson <kst-u@mib.org> - 2018-10-02 13:59 -0700
Re: Counting lines of a file Bart <bc@freeuk.com> - 2018-10-02 23:07 +0100
Re: Counting lines of a file Bart <bc@freeuk.com> - 2018-10-03 00:08 +0100
Re: Counting lines of a file Keith Thompson <kst-u@mib.org> - 2018-10-02 16:51 -0700
Re: Counting lines of a file "Rick C. Hodgin" <rick.c.hodgin@gmail.com> - 2018-10-02 17:47 -0400
Re: Counting lines of a file Anton Shepelev <anton.txt@g{oogle}mail.com> - 2018-10-03 11:57 +0300
Re: Counting lines of a file James Kuyper <jameskuyper@alumni.caltech.edu> - 2018-10-03 06:30 -0400
Re: Counting lines of a file Anton Shepelev <anton.txt@g{oogle}mail.com> - 2018-10-03 15:37 +0300
Re: Counting lines of a file "Rick C. Hodgin" <rick.c.hodgin@gmail.com> - 2018-10-03 05:20 -0700
Re: Counting lines of a file "Rick C. Hodgin" <rick.c.hodgin@gmail.com> - 2018-10-03 05:33 -0700
Re: Counting lines of a file "Rick C. Hodgin" <rick.c.hodgin@gmail.com> - 2018-10-03 05:55 -0700
Re: Counting lines of a file Ben Bacarisse <ben.usenet@bsb.me.uk> - 2018-10-03 22:33 +0100
Re: Counting lines of a file "Rick C. Hodgin" <rick.c.hodgin@gmail.com> - 2018-10-03 17:43 -0400
Re: Counting lines of a file Ben Bacarisse <ben.usenet@bsb.me.uk> - 2018-10-04 02:49 +0100
Re: Counting lines of a file "Rick C. Hodgin" <rick.c.hodgin@gmail.com> - 2018-10-03 22:06 -0400
Re: Counting lines of a file gazelle@shell.xmission.com (Kenny McCormack) - 2018-10-04 05:20 +0000
Re: Counting lines of a file already5chosen@yahoo.com - 2018-10-04 02:45 -0700
Re: Counting lines of a file Ben Bacarisse <ben.usenet@bsb.me.uk> - 2018-10-04 14:42 +0100
Re: Counting lines of a file Bart <bc@freeuk.com> - 2018-10-04 11:27 +0100
Re: Counting lines of a file already5chosen@yahoo.com - 2018-10-04 03:40 -0700
Re: Counting lines of a file Ben Bacarisse <ben.usenet@bsb.me.uk> - 2018-10-04 15:17 +0100
Re: Counting lines of a file Bart <bc@freeuk.com> - 2018-10-04 18:13 +0100
Re: Counting lines of a file scott@slp53.sl.home (Scott Lurndal) - 2018-10-04 17:47 +0000
Re: Counting lines of a file Bart <bc@freeuk.com> - 2018-10-04 20:49 +0100
Re: Counting lines of a file nobody@example.org (Scott) - 2018-10-05 16:52 +0000
Re: Counting lines of a file Ben Bacarisse <ben.usenet@bsb.me.uk> - 2018-10-05 01:49 +0100
Re: Counting lines of a file Bart <bc@freeuk.com> - 2018-10-05 12:08 +0100
Re: Counting lines of a file Ben Bacarisse <ben.usenet@bsb.me.uk> - 2018-10-06 03:24 +0100
Re: Counting lines of a file Spiros Bousbouras <spibou@gmail.com> - 2018-10-06 03:47 +0000
Re: Counting lines of a file Ben Bacarisse <ben.usenet@bsb.me.uk> - 2018-10-06 14:41 +0100
Re: Counting lines of a file Spiros Bousbouras <spibou@gmail.com> - 2018-10-06 15:05 +0000
Re: Counting lines of a file Ben Bacarisse <ben.usenet@bsb.me.uk> - 2018-10-06 20:08 +0100
Re: Counting lines of a file Bart <bc@freeuk.com> - 2018-10-06 13:02 +0100
Re: Counting lines of a file Ben Bacarisse <ben.usenet@bsb.me.uk> - 2018-10-06 15:51 +0100
Re: Counting lines of a file Bart <bc@freeuk.com> - 2018-10-06 17:15 +0100
Re: Counting lines of a file Keith Thompson <kst-u@mib.org> - 2018-10-06 13:22 -0700
Re: Counting lines of a file Bart <bc@freeuk.com> - 2018-10-06 22:27 +0100
Re: Counting lines of a file Ian Collins <ian-news@hotmail.com> - 2018-10-07 11:55 +1300
Re: Counting lines of a file Bart <bc@freeuk.com> - 2018-10-07 00:02 +0100
Re: Counting lines of a file Ian Collins <ian-news@hotmail.com> - 2018-10-07 12:10 +1300
Re: Counting lines of a file Bart <bc@freeuk.com> - 2018-10-07 01:33 +0100
Re: Counting lines of a file mark.bluemel@gmail.com - 2018-10-08 01:33 -0700
Re: Counting lines of a file Bart <bc@freeuk.com> - 2018-10-08 12:20 +0100
Re: Counting lines of a file Ben Bacarisse <ben.usenet@bsb.me.uk> - 2018-10-06 21:51 +0100
Re: Counting lines of a file already5chosen@yahoo.com - 2018-10-06 12:52 -0700
Re: Counting lines of a file already5chosen@yahoo.com - 2018-10-06 13:01 -0700
Re: Counting lines of a file Ben Bacarisse <ben.usenet@bsb.me.uk> - 2018-10-06 22:01 +0100
Re: Counting lines of a file Keith Thompson <kst-u@mib.org> - 2018-10-06 13:17 -0700
Re: Counting lines of a file antispam@math.uni.wroc.pl - 2018-12-17 20:50 +0000
Re: Counting lines of a file Anton Shepelev <anton.txt@gmail.com> - 2018-10-05 23:09 +0300
Re: Counting lines of a file Malcolm McLean <malcolm.arthur.mclean@gmail.com> - 2018-10-06 04:02 -0700
Re: Counting lines of a file Anton Shepelev <anton.txt@gmail.com> - 2018-10-07 00:29 +0300
Re: Counting lines of a file scott@slp53.sl.home (Scott Lurndal) - 2018-10-04 13:22 +0000
Re: Counting lines of a file "Rick C. Hodgin" <rick.c.hodgin@gmail.com> - 2018-10-04 08:00 -0700
Re: Counting lines of a file scott@slp53.sl.home (Scott Lurndal) - 2018-10-04 15:30 +0000
Re: Counting lines of a file "Rick C. Hodgin" <rick.c.hodgin@gmail.com> - 2018-10-04 08:34 -0700
Re: Counting lines of a file Malcolm McLean <malcolm.arthur.mclean@gmail.com> - 2018-10-04 09:27 -0700
Re: Counting lines of a file "Rick C. Hodgin" <rick.c.hodgin@gmail.com> - 2018-10-04 11:04 -0700
Re: Counting lines of a file Bart <bc@freeuk.com> - 2018-10-03 22:50 +0100
Re: Counting lines of a file Ian Collins <ian-news@hotmail.com> - 2018-10-04 11:30 +1300
Re: Counting lines of a file Keith Thompson <kst-u@mib.org> - 2018-10-03 15:41 -0700
Re: Counting lines of a file Bart <bc@freeuk.com> - 2018-10-04 00:46 +0100
Re: Counting lines of a file Ian Collins <ian-news@hotmail.com> - 2018-10-04 13:01 +1300
Re: Counting lines of a file Bart <bc@freeuk.com> - 2018-10-04 01:22 +0100
Re: Counting lines of a file Ian Collins <ian-news@hotmail.com> - 2018-10-04 13:39 +1300
Re: Counting lines of a file Keith Thompson <kst-u@mib.org> - 2018-10-03 18:23 -0700
Re: Counting lines of a file Bart <bc@freeuk.com> - 2018-10-03 13:33 +0100
Re: Counting lines of a file Anton Shepelev <anton.txt@g{oogle}mail.com> - 2018-10-03 15:40 +0300
Re: Counting lines of a file "Rick C. Hodgin" <rick.c.hodgin@gmail.com> - 2018-10-03 05:57 -0700
Re: Counting lines of a file Ben Bacarisse <ben.usenet@bsb.me.uk> - 2018-10-03 22:19 +0100
Re: Counting lines of a file Ian Collins <ian-news@hotmail.com> - 2018-10-03 11:25 +1300
Re: Counting lines of a file "Rick C. Hodgin" <rick.c.hodgin@gmail.com> - 2018-10-02 18:56 -0400
Re: Counting lines of a file Anton Shepelev <anton.txt@g{oogle}mail.com> - 2018-10-03 12:11 +0300
Re: Counting lines of a file Ian Collins <ian-news@hotmail.com> - 2018-10-03 23:06 +1300
Re: Counting lines of a file Anton Shepelev <ant0n.txt@gmai1.c0m> - 2018-10-03 14:58 +0300
Re: Counting lines of a file Ian Collins <ian-news@hotmail.com> - 2018-10-04 08:08 +1300
Re: Counting lines of a file "Rick C. Hodgin" <rick.c.hodgin@gmail.com> - 2018-10-03 05:06 -0700
Re: Counting lines of a file Anton Shepelev <anton.txt@g{oogle}mail.com> - 2018-10-03 15:13 +0300
Re: Counting lines of a file "Rick C. Hodgin" <rick.c.hodgin@gmail.com> - 2018-10-03 05:26 -0700
Re: Counting lines of a file Ben Bacarisse <ben.usenet@bsb.me.uk> - 2018-10-03 02:59 +0100
Re: Counting lines of a file jacobnavia <jacob@jacob.remcomp.fr> - 2018-10-03 08:57 +0200
Re: Counting lines of a file jacobnavia <jacob@jacob.remcomp.fr> - 2018-10-03 08:59 +0200
Re: Counting lines of a file Ben Bacarisse <ben.usenet@bsb.me.uk> - 2018-10-03 21:54 +0100
Re: Counting lines of a file jacobnavia <jacob@jacob.remcomp.fr> - 2018-10-03 23:26 +0200
Re: Counting lines of a file Bart <bc@freeuk.com> - 2018-10-03 22:41 +0100
Re: Counting lines of a file Ben Bacarisse <ben.usenet@bsb.me.uk> - 2018-10-04 02:23 +0100
Re: Counting lines of a file Keith Thompson <kst-u@mib.org> - 2018-10-03 14:59 -0700
Re: Counting lines of a file Ben Bacarisse <ben.usenet@bsb.me.uk> - 2018-10-04 03:04 +0100
Re: Counting lines of a file jacobnavia <jacob@jacob.remcomp.fr> - 2018-10-03 09:01 +0200
Re: Counting lines of a file Ben Bacarisse <ben.usenet@bsb.me.uk> - 2018-10-03 22:01 +0100
Re: Counting lines of a file jacobnavia <jacob@jacob.remcomp.fr> - 2018-10-03 21:44 +0200
Re: Counting lines of a file "Rick C. Hodgin" <rick.c.hodgin@gmail.com> - 2018-10-03 15:48 -0400
Re: Counting lines of a file Anton Shepelev <anton.txt@gmail.com> - 2018-10-03 23:15 +0300
Re: Counting lines of a file Keith Thompson <kst-u@mib.org> - 2018-10-03 13:35 -0700
Re: Counting lines of a file Anton Shepelev <anton.txt@gmail.com> - 2018-10-04 00:14 +0300
Re: Counting lines of a file Bart <bc@freeuk.com> - 2018-10-03 23:15 +0100
Re: Counting lines of a file Anton Shepelev <anton.txt@gmail.com> - 2018-10-04 23:28 +0300
Re: Counting lines of a file James Kuyper <jameskuyper@alumni.caltech.edu> - 2018-10-03 19:39 -0400
Re: Counting lines of a file Nick Bowler <nbowler@draconx.ca> - 2018-10-04 15:31 +0000
Re: Counting lines of a file Ben Bacarisse <ben.usenet@bsb.me.uk> - 2018-10-04 01:05 +0100
Re: Counting lines of a file jacobnavia <jacob@jacob.remcomp.fr> - 2018-10-04 14:04 +0200
Re: Counting lines of a file Ben Bacarisse <ben.usenet@bsb.me.uk> - 2018-10-04 15:48 +0100
Re: Counting lines of a file jacobnavia <jacob@jacob.remcomp.fr> - 2018-10-05 18:29 +0200
Re: Counting lines of a file Joey Pabalinas <joeypabalinas@gmail.com> - 2018-12-16 07:50 -1000
Re: Counting lines of a file Joey Pabalinas <joeypabalinas@gmail.com> - 2018-12-16 07:54 -1000
Re: Counting lines of a file rbowman <bowman@montana.com> - 2018-12-16 12:51 -0700
Re: Counting lines of a file Jorgen Grahn <grahn+nntp@snipabacken.se> - 2018-12-16 20:51 +0000
Re: Counting lines of a file rbowman <bowman@montana.com> - 2018-12-16 14:40 -0700
Re: Counting lines of a file Jorgen Grahn <grahn+nntp@snipabacken.se> - 2018-12-16 21:50 +0000
Re: Counting lines of a file Keith Thompson <kst-u@mib.org> - 2018-12-16 15:38 -0800
Re: Counting lines of a file rbowman <bowman@montana.com> - 2018-12-16 20:29 -0700
Re: Counting lines of a file Jorgen Grahn <grahn+nntp@snipabacken.se> - 2018-12-18 21:03 +0000
Re: Counting lines of a file Ben Bacarisse <ben.usenet@bsb.me.uk> - 2018-12-16 21:17 +0000
Re: Counting lines of a file Joey Pabalinas <joeypabalinas@gmail.com> - 2018-12-16 17:13 -1000
Re: Counting lines of a file rbowman <bowman@montana.com> - 2018-12-16 23:11 -0700
Re: Counting lines of a file Joey Pabalinas <joeypabalinas@gmail.com> - 2018-12-16 22:05 -1000
Re: Counting lines of a file Keith Thompson <kst-u@mib.org> - 2018-12-17 11:52 -0800
Re: Counting lines of a file luser droog <luser.droog@gmail.com> - 2018-12-17 16:01 -0800
Re: Counting lines of a file Keith Thompson <kst-u@mib.org> - 2018-12-17 17:35 -0800
Re: Counting lines of a file fir <profesor.fir@gmail.com> - 2018-12-19 15:54 -0800
Re: Counting lines of a file rbowman <bowman@montana.com> - 2018-12-17 20:01 -0700
Re: Counting lines of a file Ike Naar <ike@iceland.freeshell.org> - 2018-12-18 07:44 +0000
Re: Counting lines of a file nobody@example.org (Scott) - 2018-12-18 09:29 +0000
Re: Counting lines of a file David Brown <david.brown@hesbynett.no> - 2018-12-18 13:18 +0100
Re: Counting lines of a file James Kuyper <jameskuyper@alumni.caltech.edu> - 2018-12-18 06:10 -0800
Re: Counting lines of a file rbowman <bowman@montana.com> - 2018-12-18 08:12 -0700
Re: Counting lines of a file "Rick C. Hodgin" <rick.c.hodgin@gmail.com> - 2018-12-19 07:47 -0800
Re: Counting lines of a file Ben Bacarisse <ben.usenet@bsb.me.uk> - 2018-12-16 20:41 +0000
Re: Counting lines of a file scott@slp53.sl.home (Scott Lurndal) - 2018-12-17 15:18 +0000
Page 1 of 11 [1] 2 3 … 11 Next page →
| From | jacobnavia <jacob@jacob.remcomp.fr> |
|---|---|
| Date | 2018-10-02 22:37 +0200 |
| Subject | Counting lines of a file |
| Message-ID | <pp0kts$b17$1@dont-email.me> |
Unix has the "wc" utility to count the lines of a file. It is a pity
that under linux that program is unusable to count lines in a hierarchy
of several directories. It requires ZERO terminated file names, and the
"find" utility produces \n terminated file names, so it is unusable for
that.
So, I decided to rewrite "wc" as "lc" (for Line Count")
It took me a few hours, and I wanted to post the result here, since it
is (maybe) a useful program, and the way I wrote it explain some
opinions I have about software design.
Here it is:
-----------------------------------------------cut here
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
#include <string.h>
/* Go through all file names and find out the longest one.
This allows to align results.
*/
static int FindMaxFileNameLength(char *argv[])
{
int i,len;
int Maxlen=-1;
for (i=1; argv[i];i++) {
len = strlen(argv[i]);
if (len > Maxlen)
Maxlen = len;
}
return Maxlen;
}
/* Copy the file name into the first n chars, starting at the leftmost */
static void PadName(char *buf, char *name,int maxlen)
{
memset(buf,' ',maxlen);
memcpy(buf,name,strlen(name));
buf[maxlen]=0;
}
#define CHUNKSIZE 4096
static char ** ReadFromStdin(int *pargc)
{
// Assumption: No file name exceeds 4K +
// space for the terminating zero
char inbuf[4096+1];
// An array holding the file names that will grow by chunks
char **fileNameArray = calloc(CHUNKSIZE,sizeof(char *));
int fileCount = 0; // Counts how many files allocated in this chunk
int totalFileCount=1; //Index into the array. Note: starts at 1!
char *p; // Used to eliminate the '\n'
while (fgets(inbuf,sizeof(inbuf),stdin)) {
fileNameArray[totalFileCount] = malloc(strlen(inbuf)+1);
if (fileNameArray[totalFileCount] == NULL)
return NULL;
// Eliminate the '\n'.
// If we do not do this, fopen will fail
p = strchr(inbuf,'\n');
if (p) *p=0;
strcpy(fileNameArray[totalFileCount],inbuf);
fileCount++;
totalFileCount++;
if (fileCount >= CHUNKSIZE) {
char **tmp = realloc(fileNameArray,
(totalFileCount+CHUNKSIZE) * sizeof(char *));
// If reallocation failed return NULL leaking
// all the memory allocated
// so far, assuming main will exit and OS will
// reclaim memory
if (tmp == NULL)
return NULL;
fileNameArray = tmp;
fileCount = 0;
}
}
*pargc = totalFileCount;
return fileNameArray;
}
int main(int argc,char *argv[])
{
int fileCount=0;
int c;
int titleHasBeenWritten = 0;
int maxlen;
int32_t lines=0;
int64_t bytes=0;
int64_t totalLines=0;
int64_t totalBytes=0;
char *PaddedFileName;
// If called with no arguments print a usage message and exit */
if (argc < 2) {
fprintf(stderr,"Usage: lc <files>\n or\nlc -\n");
return EXIT_FAILURE;
}
/* If there is only one argument, and it is just a dash - ,
it means that the file names should be read from standard
input */
if (argc == 2 && !strcmp(argv[1],"-")) {
argv = ReadFromStdin(&argc);
if (argv == NULL) {
nomem:
fprintf(stderr,"No more memory\n");
exit(EXIT_FAILURE);
}
}
maxlen = FindMaxFileNameLength(argv);
// If we want to write the totals we should reserve at
// least 5 chars to write
// the word "Total" (5 characters)
if (maxlen < 5) maxlen = 5;
PaddedFileName = calloc(1,maxlen+1);
if (PaddedFileName == NULL) {
goto nomem;
}
PadName(PaddedFileName,"File",maxlen);
for (fileCount=1; argv[fileCount]; fileCount++) {
FILE *infile = fopen(argv[fileCount],"rb");
if (infile == NULL) {
fprintf(stderr,
"Impossible to open %s\n",argv[fileCount]);
continue;
}
c = fgetc(infile);
while (c != EOF) {
bytes++;
if (c == '\n')
lines++;
c = fgetc(infile);
}
totalBytes += bytes;
totalLines += lines;
if (!titleHasBeenWritten) {
printf("%s %9s | %8s\n",
PaddedFileName," Bytes","Lines");
titleHasBeenWritten = 1;
}
PadName(PaddedFileName,argv[fileCount],maxlen);
printf("%s:%9d | %8d \n",PaddedFileName,bytes,lines);
bytes = lines = 0;
fclose(infile);
}
if (fileCount > 2) {
PadName(PaddedFileName,"Total",maxlen);
printf("%s %9d | %8d\n",
PaddedFileName,totalBytes,totalLines);
}
return EXIT_SUCCESS;
}
[toc] | [next] | [standalone]
| From | Lew Pitcher <lew.pitcher@digitalfreehold.ca> |
|---|---|
| Date | 2018-10-02 16:45 -0400 |
| Message-ID | <pp0le6$e9n$1@dont-email.me> |
| In reply to | #136032 |
jacobnavia wrote: > Unix has the "wc" utility to count the lines of a file. It is a pity > that under linux that program is unusable to count lines in a hierarchy > of several directories. It requires ZERO terminated file names, and the > "find" utility produces \n terminated file names, so it is unusable for > that. find . -type f -print0 | wc --files0-from=- HTH -- Lew Pitcher "In Skills, We Trust"
[toc] | [prev] | [next] | [standalone]
| From | Ian Collins <ian-news@hotmail.com> |
|---|---|
| Date | 2018-10-03 09:51 +1300 |
| Message-ID | <g1i43gFev09U3@mid.individual.net> |
| In reply to | #136035 |
On 03/10/18 09:45, Lew Pitcher wrote: > jacobnavia wrote: > >> Unix has the "wc" utility to count the lines of a file. It is a pity >> that under linux that program is unusable to count lines in a hierarchy >> of several directories. It requires ZERO terminated file names, and the >> "find" utility produces \n terminated file names, so it is unusable for >> that. > > find . -type f -print0 | wc --files0-from=- You don't even need the -print0.. for i in `find . -name *.c`; do wc $i; done works fine. -- Ian.
[toc] | [prev] | [next] | [standalone]
| From | jacobnavia <jacob@jacob.remcomp.fr> |
|---|---|
| Date | 2018-10-02 22:55 +0200 |
| Message-ID | <pp0m05$f04$2@dont-email.me> |
| In reply to | #136037 |
Le 02/10/2018 à 22:51, Ian Collins a écrit : > On 03/10/18 09:45, Lew Pitcher wrote: >> jacobnavia wrote: >> >>> Unix has the "wc" utility to count the lines of a file. It is a pity >>> that under linux that program is unusable to count lines in a hierarchy >>> of several directories. It requires ZERO terminated file names, and the >>> "find" utility produces \n terminated file names, so it is unusable for >>> that. >> >> find . -type f -print0 | wc --files0-from=- > > You don't even need the -print0.. > > for i in `find . -name *.c`; do wc $i; done > > works fine. > off topic. The topic was the program in C.
[toc] | [prev] | [next] | [standalone]
| From | Keith Thompson <kst-u@mib.org> |
|---|---|
| Date | 2018-10-02 14:31 -0700 |
| Message-ID | <lnzhvw592p.fsf@kst-u.example.com> |
| In reply to | #136039 |
jacobnavia <jacob@jacob.remcomp.fr> writes:
> Le 02/10/2018 à 22:51, Ian Collins a écrit :
>> On 03/10/18 09:45, Lew Pitcher wrote:
>>> jacobnavia wrote:
>>>
>>>> Unix has the "wc" utility to count the lines of a file. It is a pity
>>>> that under linux that program is unusable to count lines in a hierarchy
>>>> of several directories. It requires ZERO terminated file names, and the
>>>> "find" utility produces \n terminated file names, so it is unusable for
>>>> that.
>>>
>>> find . -type f -print0 | wc --files0-from=-
>>
>> You don't even need the -print0..
>>
>> for i in `find . -name *.c`; do wc $i; done
>>
>> works fine.
>>
> off topic.
>
> The topic was the program in C.
You said that the reason for your program was to work around "wc"
and "find" not doing what you want. The fact that they do certainly
seems topical for this thread.
--
Keith Thompson (The_Other_Keith) kst-u@mib.org <http://www.ghoti.net/~kst>
Working, but not speaking, for JetHead Development, Inc.
"We must do something. This is something. Therefore, we must do this."
-- Antony Jay and Jonathan Lynn, "Yes Minister"
[toc] | [prev] | [next] | [standalone]
| From | jacobnavia <jacob@jacob.remcomp.fr> |
|---|---|
| Date | 2018-10-02 23:39 +0200 |
| Message-ID | <pp0ohr$1nl$1@dont-email.me> |
| In reply to | #136053 |
Le 02/10/2018 à 23:31, Keith Thompson a écrit : > jacobnavia <jacob@jacob.remcomp.fr> writes: >> Le 02/10/2018 à 22:51, Ian Collins a écrit : >>> On 03/10/18 09:45, Lew Pitcher wrote: >>>> jacobnavia wrote: >>>> >>>>> Unix has the "wc" utility to count the lines of a file. It is a pity >>>>> that under linux that program is unusable to count lines in a hierarchy >>>>> of several directories. It requires ZERO terminated file names, and the >>>>> "find" utility produces \n terminated file names, so it is unusable for >>>>> that. >>>> >>>> find . -type f -print0 | wc --files0-from=- >>> >>> You don't even need the -print0.. >>> >>> for i in `find . -name *.c`; do wc $i; done >>> >>> works fine. >>> >> off topic. >> >> The topic was the program in C. > > You said that the reason for your program was to work around "wc" > and "find" not doing what you want. The fact that they do certainly > seems topical for this thread. > No, I do not really care about that. What I wanted to show is a simple program that does most of what "wc" does, but it is not "over engineered", and tries to cope with all possible files with weird characters in it. There is a balance to be kept between simplicity and usefulness, between having very complicated programs full of features nobody will ever use and too simple programs that fail at the slightest error. For instance that "print0" option, that only unix gurus will ever know about. When I saw the doc of wc, I never even thought about the possibility that "find" would print a zero after the file name, and I didn't even know that you can put a newline in a file name. Actually, I have never seen in 25 years of UNix use, a file with a new line in its name. Is that really useful?
[toc] | [prev] | [next] | [standalone]
| From | Keith Thompson <kst-u@mib.org> |
|---|---|
| Date | 2018-10-02 16:39 -0700 |
| Message-ID | <lno9cb6hq2.fsf@kst-u.example.com> |
| In reply to | #136056 |
jacobnavia <jacob@jacob.remcomp.fr> writes:
> Le 02/10/2018 à 23:31, Keith Thompson a écrit :
>> jacobnavia <jacob@jacob.remcomp.fr> writes:
>>> Le 02/10/2018 à 22:51, Ian Collins a écrit :
>>>> On 03/10/18 09:45, Lew Pitcher wrote:
>>>>> jacobnavia wrote:
>>>>>
>>>>>> Unix has the "wc" utility to count the lines of a file. It is a pity
>>>>>> that under linux that program is unusable to count lines in a hierarchy
>>>>>> of several directories. It requires ZERO terminated file names, and the
>>>>>> "find" utility produces \n terminated file names, so it is unusable for
>>>>>> that.
>>>>>
>>>>> find . -type f -print0 | wc --files0-from=-
>>>>
>>>> You don't even need the -print0..
>>>>
>>>> for i in `find . -name *.c`; do wc $i; done
>>>>
>>>> works fine.
>>>>
>>> off topic.
>>>
>>> The topic was the program in C.
>>
>> You said that the reason for your program was to work around "wc"
>> and "find" not doing what you want. The fact that they do certainly
>> seems topical for this thread.
>>
> No, I do not really care about that. What I wanted to show is a simple
> program that does most of what "wc" does, but it is not "over
> engineered", and tries to cope with all possible files with weird
> characters in it.
If you don't care about that, I have to wonder why you explained it as
the rationale for writing the program in the first place (quoted above).
[...]
> For instance that "print0" option, that only unix gurus will ever know
> about.
And now you know about it too.
> When I saw the doc of wc, I never even thought about the possibility
> that "find" would print a zero after the file name, and I didn't even
> know that you can put a newline in a file name. Actually, I have never
> seen in 25 years of UNix use, a file with a new line in its name.
>
> Is that really useful?
I hadn't noticed that wc option before today. From `wc --help`:
--files0-from=F read input from the files specified by
NUL-terminated names in file F;
If F is - then read names from standard input
The fact that the list is NUL-terminated makes it obvious (to me) that
it's meant to be used with the output of `find -print0`. And it's
explained in the documentation (type "info wc").
And yes, it's useful. It's the difference between working correctly
99.9+% of the time and working correctly 100% of the time -- and those
rare cases where it doesn't work could be constructed maliciously. (I
think your program would just print a spurious error message for such
cases.)
find . -type f -print0 | wc --files0-from=-
works. I can't do that with your program.
--
Keith Thompson (The_Other_Keith) kst-u@mib.org <http://www.ghoti.net/~kst>
Working, but not speaking, for JetHead Development, Inc.
"We must do something. This is something. Therefore, we must do this."
-- Antony Jay and Jonathan Lynn, "Yes Minister"
[toc] | [prev] | [next] | [standalone]
| From | jacobnavia <jacob@jacob.remcomp.fr> |
|---|---|
| Date | 2018-10-03 08:49 +0200 |
| Message-ID | <pp1oqm$k9l$1@dont-email.me> |
| In reply to | #136068 |
Le 03/10/2018 à 01:39, Keith Thompson a écrit : > I can't do that with your program. Yes you can: find . -name "*.[ch]” | lc - That will print correctly formaytted information
[toc] | [prev] | [next] | [standalone]
| From | Keith Thompson <kst-u@mib.org> |
|---|---|
| Date | 2018-10-03 11:46 -0700 |
| Message-ID | <lnbm8a6f6n.fsf@kst-u.example.com> |
| In reply to | #136071 |
jacobnavia <jacob@jacob.remcomp.fr> writes:
> Le 03/10/2018 à 01:39, Keith Thompson a écrit :
>> I can't do that with your program.
>
> Yes you can:
>
> find . -name "*.[ch]" | lc -
>
> That will print correctly formaytted information
You snipped too much context.
What I said I can't do with your program is:
find . -type f -print0 | wc --files0-from=-
What I meant is that your program can't take a list of files
delimited by null characters, which means (I think, I haven't closely
studied your code) it can't process those very rare files that have
newlines in their names.
It's a rare requirement, but it's one that the existing tools
support out of the box. If you know about "find -print0" and
"wc --files0-from=" (which you do now) you can handle *all* files
regardless of what some silly person has decided to name them.
And it doesn't require writing any new code; the tools already exist.
Incidentally, I don't *think* that trying to run your program on
files with newlines in their names will cause it to do anything
nasty. At worst, it could be made to process some files twice
($'foo\nbar' will cause it to try to open 'foo' and 'bar'). But I
could probably write a fairly simple shell command that would
execute some arbitrary code given maliciously constructed file names.
Your program arguably solves *most* of the problem, but existing tools
already solve all of it.
--
Keith Thompson (The_Other_Keith) kst-u@mib.org <http://www.ghoti.net/~kst>
Working, but not speaking, for JetHead Development, Inc.
"We must do something. This is something. Therefore, we must do this."
-- Antony Jay and Jonathan Lynn, "Yes Minister"
[toc] | [prev] | [next] | [standalone]
| From | scott@slp53.sl.home (Scott Lurndal) |
|---|---|
| Date | 2018-10-02 21:04 +0000 |
| Message-ID | <Q3RsD.86048$MJ2.43787@fx12.iad> |
| In reply to | #136037 |
Ian Collins <ian-news@hotmail.com> writes: > Thunderbird/52.9.1 >In-Reply-To: <pp0le6$e9n$1@dont-email.me> >Content-Language: en-US >X-Received-Bytes: 1394 >X-Received-Body-CRC: 582717886 > >On 03/10/18 09:45, Lew Pitcher wrote: >> jacobnavia wrote: >> >>> Unix has the "wc" utility to count the lines of a file. It is a pity >>> that under linux that program is unusable to count lines in a hierarchy >>> of several directories. It requires ZERO terminated file names, and the >>> "find" utility produces \n terminated file names, so it is unusable for >>> that. >> >> find . -type f -print0 | wc --files0-from=- > >You don't even need the -print0.. > >for i in `find . -name *.c`; do wc $i; done > >works fine. If there are enough filenames produced by the find command to exceed the maximum argument length (ARG_MAX), then the pipe is preferred over the for loop (to avoid "argument list too long" errors from the shell).
[toc] | [prev] | [next] | [standalone]
| From | dave_thompson_2@comcast.net |
|---|---|
| Date | 2018-12-14 17:52 -0500 |
| Message-ID | <kuc81eh0sv6l5mr3qnj2m7c9dnqjd1sk5v@4ax.com> |
| In reply to | #136045 |
On Tue, 02 Oct 2018 21:04:48 GMT, scott@slp53.sl.home (Scott Lurndal)
wrote:
> Ian Collins <ian-news@hotmail.com> writes:
> >On 03/10/18 09:45, Lew Pitcher wrote:
> >> jacobnavia wrote:
> >>
> >>> Unix has the "wc" utility to count the lines of a file. It is a pity
> >>> that under linux that program is unusable to count lines in a hierarchy
> >>> of several directories. It requires ZERO terminated file names, and the
> >>> "find" utility produces \n terminated file names, so it is unusable for
> >>> that.
> >>
> >> find . -type f -print0 | wc --files0-from=-
> >
> >You don't even need the -print0..
> >
> >for i in `find . -name *.c`; do wc $i; done
> >
> >works fine.
>
> If there are enough filenames produced by the find
> command to exceed the maximum argument length (ARG_MAX), then the
> pipe is preferred over the for loop (to avoid "argument list too long" errors
> from the shell).
No. wc $(find blah) tries to pass all the names to one process, and
fails if it exceeds ARG_MAX; for i in $(find blah) ... only needs to
fit them in shell memory (which is much larger, though not infinite).
Note $(...) is preferred to `...` in Bourne/Korn-ish shells because it
can nest and doesn't cause 'leaning toothpick' style quoting problems.
(Although C-ish shells, and perl, are stuck with `...`.)
For that matter, find blah | xargs wc -- maybe with -I{} or similar --
and find blah -exec wc {} + pass as many files as possible per process
but automatically 'split' to multiple processes as needed. GNU
parallel can do the same as xargs and more.
[toc] | [prev] | [next] | [standalone]
| From | Jorgen Grahn <grahn+nntp@snipabacken.se> |
|---|---|
| Date | 2018-12-15 08:14 +0000 |
| Message-ID | <slrnq19dvt.1p1h.grahn+nntp@frailea.sa.invalid> |
| In reply to | #138693 |
On Fri, 2018-12-14, dave_thompson_2@comcast.net wrote:
> On Tue, 02 Oct 2018 21:04:48 GMT, scott@slp53.sl.home (Scott Lurndal)
> wrote:
>
>> Ian Collins <ian-news@hotmail.com> writes:
>
>> >On 03/10/18 09:45, Lew Pitcher wrote:
>> >> jacobnavia wrote:
>> >>
>> >>> Unix has the "wc" utility to count the lines of a file. It is a pity
>> >>> that under linux that program is unusable to count lines in a hierarchy
>> >>> of several directories. It requires ZERO terminated file names, and the
>> >>> "find" utility produces \n terminated file names, so it is unusable for
>> >>> that.
>> >>
>> >> find . -type f -print0 | wc --files0-from=-
>> >
>> >You don't even need the -print0..
>> >
>> >for i in `find . -name *.c`; do wc $i; done
>> >
>> >works fine.
>>
>> If there are enough filenames produced by the find command to
>> exceed the maximum argument length (ARG_MAX), then the pipe is
>> preferred over the for loop (to avoid "argument list too long"
>> errors from the shell).
>
> No. wc $(find blah) tries to pass all the names to one process, and
> fails if it exceeds ARG_MAX; for i in $(find blah) ... only needs to
> fit them in shell memory (which is much larger, though not infinite).
ARG_MAX seems to be fairly large nowadays: my Linux headers say 128
KB, and OpenBSD says 256 KB. I still use xargs most of the time,
though.
> Note $(...) is preferred to `...` in Bourne/Korn-ish shells because it
> can nest and doesn't cause 'leaning toothpick' style quoting problems.
> (Although C-ish shells, and perl, are stuck with `...`.)
Perl has qx{}; see perlop(1).
> For that matter, find blah | xargs wc -- maybe with -I{} or similar --
> and find blah -exec wc {} + pass as many files as possible per process
> but automatically 'split' to multiple processes as needed. GNU
> parallel can do the same as xargs and more.
GNU xargs also has -P n, although I personally don't have much
experience with that option, or with parallel(1).
/Jorgen
--
// Jorgen Grahn <grahn@ Oo o. . .
\X/ snipabacken.se> O o .
[toc] | [prev] | [next] | [standalone]
| From | Nick Bowler <nbowler@draconx.ca> |
|---|---|
| Date | 2018-10-02 21:24 +0000 |
| Message-ID | <pp0nmf$33b$3@dont-email.me> |
| In reply to | #136037 |
On Wed, 03 Oct 2018 09:51:59 +1300, Ian Collins wrote: > On 03/10/18 09:45, Lew Pitcher wrote: >> jacobnavia wrote: >> >>> Unix has the "wc" utility to count the lines of a file. It is a pity >>> that under linux that program is unusable to count lines in a hierarchy >>> of several directories. It requires ZERO terminated file names, and the >>> "find" utility produces \n terminated file names, so it is unusable for >>> that. >> >> find . -type f -print0 | wc --files0-from=- > > You don't even need the -print0.. > > for i in `find . -name *.c`; do wc $i; done > > works fine. For some definition of "works fine": it will fail quite badly if any matched filename contains any of a large set of characters special to the shell. For example, try running it in a directory containing a file called (without quotes) '* .c'; i.e., the file's name is the four character sequence asterisk, space, period, and c.
[toc] | [prev] | [next] | [standalone]
| From | jacobnavia <jacob@jacob.remcomp.fr> |
|---|---|
| Date | 2018-10-02 23:32 +0200 |
| Message-ID | <pp0o5d$to2$2@dont-email.me> |
| In reply to | #136049 |
Le 02/10/2018 à 23:24, Nick Bowler a écrit : > On Wed, 03 Oct 2018 09:51:59 +1300, Ian Collins wrote: >> On 03/10/18 09:45, Lew Pitcher wrote: >>> jacobnavia wrote: >>> >>>> Unix has the "wc" utility to count the lines of a file. It is a pity >>>> that under linux that program is unusable to count lines in a hierarchy >>>> of several directories. It requires ZERO terminated file names, and the >>>> "find" utility produces \n terminated file names, so it is unusable for >>>> that. >>> >>> find . -type f -print0 | wc --files0-from=- >> >> You don't even need the -print0.. >> >> for i in `find . -name *.c`; do wc $i; done >> >> works fine. > > For some definition of "works fine": it will fail quite badly if any > matched filename contains any of a large set of characters special to > the shell. > > For example, try running it in a directory containing a file called > (without quotes) '* .c'; i.e., the file's name is the four character > sequence asterisk, space, period, and c. > Besides, there is no total since wc will be called for each file individually. My program prints a total...
[toc] | [prev] | [next] | [standalone]
| From | queequeg@trust.no1 (Queequeg) |
|---|---|
| Date | 2018-10-03 10:44 +0000 |
| Message-ID | <2ff4f409-fe9e-4c1e-92b1-187f6886a532@trust.no1> |
| In reply to | #136054 |
jacobnavia <jacob@jacob.remcomp.fr> wrote: > Besides, there is no total since wc will be called for each file > individually. My program prints a total... But you're aware of the cat utility, aren't you? -- https://www.youtube.com/watch?v=9lSzL1DqQn0
[toc] | [prev] | [next] | [standalone]
| From | jacobnavia <jacob@jacob.remcomp.fr> |
|---|---|
| Date | 2018-10-03 13:17 +0200 |
| Message-ID | <pp28h6$egf$1@dont-email.me> |
| In reply to | #136084 |
Le 03/10/2018 à 12:44, Queequeg a écrit : > jacobnavia <jacob@jacob.remcomp.fr> wrote: > >> Besides, there is no total since wc will be called for each file >> individually. My program prints a total... > > But you're aware of the cat utility, aren't you? > and how you would use that in this context? If you "cat" the contents of each file into stdout and pipe it to wc the boundary between each file is lost. Yes, you obtain a total but no longer the data about individual files. But I am just guessing, maybe you can explain exactly what you had in mind.
[toc] | [prev] | [next] | [standalone]
| From | David Brown <david.brown@hesbynett.no> |
|---|---|
| Date | 2018-10-03 14:35 +0200 |
| Message-ID | <pp2d2d$dbn$1@dont-email.me> |
| In reply to | #136054 |
On 02/10/18 23:32, jacobnavia wrote: > Le 02/10/2018 à 23:24, Nick Bowler a écrit : >> On Wed, 03 Oct 2018 09:51:59 +1300, Ian Collins wrote: >>> On 03/10/18 09:45, Lew Pitcher wrote: >>>> jacobnavia wrote: >>>> >>>>> Unix has the "wc" utility to count the lines of a file. It is a pity >>>>> that under linux that program is unusable to count lines in a >>>>> hierarchy >>>>> of several directories. It requires ZERO terminated file names, and >>>>> the >>>>> "find" utility produces \n terminated file names, so it is unusable >>>>> for >>>>> that. >>>> >>>> find . -type f -print0 | wc --files0-from=- >>> >>> You don't even need the -print0.. >>> >>> for i in `find . -name *.c`; do wc $i; done >>> >>> works fine. >> >> For some definition of "works fine": it will fail quite badly if any >> matched filename contains any of a large set of characters special to >> the shell. >> >> For example, try running it in a directory containing a file called >> (without quotes) '* .c'; i.e., the file's name is the four character >> sequence asterisk, space, period, and c. >> > > Besides, there is no total since wc will be called for each file > individually. My program prints a total... find . -type f -print0 | wc --files0-from=- gives the total at the end.
[toc] | [prev] | [next] | [standalone]
| From | Keith Thompson <kst-u@mib.org> |
|---|---|
| Date | 2018-10-02 14:25 -0700 |
| Message-ID | <ln8t3g6nyc.fsf@kst-u.example.com> |
| In reply to | #136037 |
Ian Collins <ian-news@hotmail.com> writes:
> On 03/10/18 09:45, Lew Pitcher wrote:
>> jacobnavia wrote:
>>
>>> Unix has the "wc" utility to count the lines of a file. It is a pity
>>> that under linux that program is unusable to count lines in a hierarchy
>>> of several directories. It requires ZERO terminated file names, and the
>>> "find" utility produces \n terminated file names, so it is unusable for
>>> that.
>>
>> find . -type f -print0 | wc --files0-from=-
>
> You don't even need the -print0..
>
> for i in `find . -name *.c`; do wc $i; done
>
> works fine.
Not if any of the directory or file names contain special characters
(spaces are distressingly common, newlines are rare but problematic
if they occur), and not if the output of the find command is too
long for a command line.
Also, the output of "wc file1; wc file2" differs from the output of
"wc file1 file2" (it prints a summary line if there's more than
one file argument).
xargs is a common solution, as is find with the "-exec" option.
The GNU findutils (xargs, find) and coreutils (wc) commands have
options that might not be supported on all systems. For example,
POSIX does not specify find's "-print0" option.
--
Keith Thompson (The_Other_Keith) kst-u@mib.org <http://www.ghoti.net/~kst>
Working, but not speaking, for JetHead Development, Inc.
"We must do something. This is something. Therefore, we must do this."
-- Antony Jay and Jonathan Lynn, "Yes Minister"
[toc] | [prev] | [next] | [standalone]
| From | jacobnavia <jacob@jacob.remcomp.fr> |
|---|---|
| Date | 2018-10-02 22:54 +0200 |
| Message-ID | <pp0lv2$f04$1@dont-email.me> |
| In reply to | #136035 |
Le 02/10/2018 à 22:45, Lew Pitcher a écrit : > jacobnavia wrote: > >> Unix has the "wc" utility to count the lines of a file. It is a pity >> that under linux that program is unusable to count lines in a hierarchy >> of several directories. It requires ZERO terminated file names, and the >> "find" utility produces \n terminated file names, so it is unusable for >> that. > > find . -type f -print0 | wc --files0-from=- > > HTH > off topic
[toc] | [prev] | [next] | [standalone]
| From | jacobnavia <jacob@jacob.remcomp.fr> |
|---|---|
| Date | 2018-10-02 23:43 +0200 |
| Message-ID | <pp0opm$1nl$2@dont-email.me> |
| In reply to | #136035 |
Le 02/10/2018 à 22:45, Lew Pitcher a écrit :
> jacobnavia wrote:
>
>> Unix has the "wc" utility to count the lines of a file. It is a pity
>> that under linux that program is unusable to count lines in a hierarchy
>> of several directories. It requires ZERO terminated file names, and the
>> "find" utility produces \n terminated file names, so it is unusable for
>> that.
>
> find . -type f -print0 | wc --files0-from=-
>
> HTH
>
The output is garbled. If I do
wc *.c
I get:
118 323 2540 alloc.c
924 3423 25951 analysis.c
14673 58447 378101 arm64.c
16673 76550 607202 asm.c
184 474 3814 aspect.c
2295 6201 55675 backend-arm.c
6 14 120 bind.c
With your solution I get:
2526 6610 60865 /home/jacob/binut/binutils-2.27/gas/dw2gencfi.c
207 735 4683 /home/jacob/binut/binutils-2.27/gas/depend.c
327 1129 6752 /home/jacob/binut/binutils-2.27/gas/rx-parse.h
236 858 5331 /home/jacob/binut/binutils-2.27/gas/sb.c
2389 8275 63129 /home/jacob/binut/binutils-2.27/gas/expr.c
23 141 897 /home/jacob/binut/binutils-2.27/gas/itbl-lex.h
It is quite difficult to read, the formatting is gone.
[toc] | [prev] | [next] | [standalone]
Page 1 of 11 [1] 2 3 … 11 Next page →
Back to top | Article view | comp.lang.c
csiph-web