cat for Windows?

All off topic discussions go here. Everything from the funny thing your cat did to your favorite tv shows. Non-programming computer questions are ok too.
Post Reply
pcmattman
Member
Member
Posts: 2566
Joined: Sun Jan 14, 2007 9:15 pm
Libera.chat IRC: miselin
Location: Sydney, Australia (I come from a land down under!)
Contact:

cat for Windows?

Post by pcmattman »

Does anyone know where I can get a version of 'cat' for windows?

I need something that'll let me do this:

Code: Select all

cat *.c > whatever.txt
ie. put all the .c files together and put them into whatever.txt.

Any ideas? I would write one, but I couldn't be bothered :D.
frank
Member
Member
Posts: 729
Joined: Sat Dec 30, 2006 2:31 pm
Location: East Coast, USA

Post by frank »

Cygwin has one.
pcmattman
Member
Member
Posts: 2566
Joined: Sun Jan 14, 2007 9:15 pm
Libera.chat IRC: miselin
Location: Sydney, Australia (I come from a land down under!)
Contact:

Post by pcmattman »

Thanks... didn't realize that.

Now I know my OS is 372 A4 pages long, 17555 lines long :D.
User avatar
Alboin
Member
Member
Posts: 1466
Joined: Thu Jan 04, 2007 3:29 pm
Location: Noricum and Pannonia

Post by Alboin »

pcmattman wrote:Thanks... didn't realize that.

Now I know my OS is 372 A4 pages long, 17555 lines long :D.
Love of Mike. The MINIX kernel is only what? 4000 lines? However, that's a microkernel, and yours...err..isn't.

What can it currently do? (Generally.)

Maybe I should resume my osdeving....That is, if this bloody Gentoo ever finishes compiling KDE...
C8H10N4O2 | #446691 | Trust the nodes.
pcmattman
Member
Member
Posts: 2566
Joined: Sun Jan 14, 2007 9:15 pm
Libera.chat IRC: miselin
Location: Sydney, Australia (I come from a land down under!)
Contact:

Post by pcmattman »

Hmmm...

Networking is what I'd say takes up a lot of that.
Other things:
Preemptive multittasking
Console i/o
File handling (two files, one for floppy and one for devices) - both huge
ATA block device driver
Floppy driver
Shell
Standard library support
15 headers (one with all PCI vendors and such)

So yeah, it is sort of big.

You can view the code if you want on my sourceforge site.

I honestly don't know whether or not it would be classed as a microkernel or whatever...
Tyler
Member
Member
Posts: 514
Joined: Tue Nov 07, 2006 7:37 am
Location: York, England

Post by Tyler »

pcmattman wrote:I honestly don't know whether or not it would be classed as a microkernel or whatever...
Do the modules of the kernel run in user mode?
pcmattman
Member
Member
Posts: 2566
Joined: Sun Jan 14, 2007 9:15 pm
Libera.chat IRC: miselin
Location: Sydney, Australia (I come from a land down under!)
Contact:

Post by pcmattman »

No. Everything is built into the kernel.

Guess that makes it a monolithic kernel?
GLneo
Member
Member
Posts: 237
Joined: Wed Dec 20, 2006 7:56 pm

Post by GLneo »

don't include headers then give us results :D , also is there a way to get cat to search directories:

Code: Select all

find /myos/ -name "*.c" | cat > out.txt
User avatar
chase
Site Admin
Posts: 710
Joined: Wed Oct 20, 2004 10:46 pm
Libera.chat IRC: chase_osdev
Location: Texas
Discord: chase/matt.heimer
Contact:

Post by chase »

I think this would have worked too:

Code: Select all

copy *.c whatever.txt
And if you wanted to cat to the screen (can't redirect it):

Code: Select all

copy *.c con
However I like cygwin alot so I'd have used cat myself. For cat'ing out all the .c files in subdirectories I think you'd want something like:

Code: Select all

find /myos -iname "*.c" -exec cat {} \; > out.txt
GLneo
Member
Member
Posts: 237
Joined: Wed Dec 20, 2006 7:56 pm

Post by GLneo »

thanks chase that seems to work. my OS is 5,973 and thats just the c files, plus i wrote every line, no coping gnu, bsd, PD, code for me!

hay! i just found this cool tool: http://www.locmetrics.com/
here is some output:
Attachments
lemonossloc.JPG
lemonossloc.JPG (33.91 KiB) Viewed 1790 times
LocMetricsPie.png
LocMetricsPie.png (3.64 KiB) Viewed 1790 times
User avatar
bubach
Member
Member
Posts: 1223
Joined: Sat Oct 23, 2004 11:00 pm
Location: Sweden
Contact:

Post by bubach »

cat is called type in dos, but as chase said, it's copy you want.
jnc100
Member
Member
Posts: 775
Joined: Mon Apr 09, 2007 12:10 pm
Location: London, UK
Contact:

Post by jnc100 »

gnuwin32 (.sourceforge.net) provides cat and loads of other gnu utils for windows. No need to get cygwin if you don't want it. Gives Windows a nice, warm fuzzy feeling...

Regards,
John.
ehird
Member
Member
Posts: 214
Joined: Thu Mar 15, 2007 8:48 am

Post by ehird »

if you were using zsh you could do `cat **/*.c > result.txt' ;) (** = any directory, recursively)
Post Reply