tags:

views:

246

answers:

4

I want to search the program ">>" that is by which you append to a file.

I run the code unsuccessfully in Mac

find . -print0 | xargs -0 grep " >> "

I get too many results to find the correct app. The program is not among other teletypes at /bin.

How can you find the program ">>"?

+6  A: 

There is no program called ">>" - it's just a part of the shell's syntax.

anon
Thank you for your answer! I was looking for a command which reappends TextA to FileA, similarly as >> but to reverse direction in the file. It seems that I need to make a separate program for that.
Masi
Masi, are you thinking something like `cat TextA >> FileA`?
Autocracy
I mean to have a command which puts TextA to the beginning of FileA.
Masi
+2  A: 

This is a shell operator, not a program at all.

Read the code for bash. Or find a simpler implementation of a Bourne Shell. There must be several on the web. Here is one http://heirloom.sourceforge.net/sh.html.

dmckee
+2  A: 

This is not a program, this is a shell construct. Try man bash.

mouviciel
+1  A: 

As others have mentioned, it's just part of the syntax. Like + and - are part of math syntax. If you want to overwrite a file, use a single >, to append use double >>. It works both ways. So if you want to use a file as input, just use <. Each line of the file will be passed to the command. command < file.txt

Brent Baisley