Re: How to overwrite a symbolic link?

2010-05-10 Thread Marc Herbert
Le 07/05/2010 16:02, Peng Yu a écrit : I can copy the whole directory and then modify one file in the newly copied N files. But I'll lose track of which file has been changed later on, which is important to me. You will not lose track of the changed files: just run a recursive diff comparing

Re: How to overwrite a symbolic link?

2010-05-09 Thread Chet Ramey
On 5/9/10 10:37 AM, Peng Yu wrote: Is there a way to define the operator ';' without touching the bash source code? No. The shell will not recognize it as a redirection, nor treat it as an operator. -- ``The lyf so short, the craft so long to lerne.'' - Chaucer ``Ars

Re: How to overwrite a symbolic link?

2010-05-07 Thread Peng Yu
On Thu, May 6, 2010 at 5:36 PM, Bob Proulx b...@proulx.com wrote: Peng Yu wrote: Is there a way to overload operators like '' and '' in bash, just as overloading in C++, etc. Suppose I have already made some bash program using '' and '' without thinking about symbolic link, but I begin aware

Re: How to overwrite a symbolic link?

2010-05-07 Thread Peng Yu
On Fri, May 7, 2010 at 9:26 AM, Marc Herbert marc.herb...@gmail.com wrote: Le 06/05/2010 15:53, Peng Yu a écrit : Suppose that I have a symbolic link link1 pointing to file1. When I write to link1, I don't want file1 change. I want it to remove the link generated a new file and write to it.

Re: How to overwrite a symbolic link?

2010-05-07 Thread Eric Blake
On 05/07/2010 09:02 AM, Peng Yu wrote: Suppose I need to modify one primary file slightly to do something a little bit different. But I still need to do the original job, therefore I need to keep it the original M files. I can copy the whole directory and then modify one file in the newly

Re: How to overwrite a symbolic link?

2010-05-07 Thread Peng Yu
On Fri, May 7, 2010 at 10:16 AM, Eric Blake ebl...@redhat.com wrote: On 05/07/2010 09:02 AM, Peng Yu wrote: Suppose I need to modify one primary file slightly to do something a little bit different. But I still need to do the original job, therefore I need to keep it the original M files. I

Re: How to overwrite a symbolic link?

2010-05-07 Thread Eric Blake
On 05/07/2010 09:31 AM, Peng Yu wrote: On Fri, May 7, 2010 at 10:16 AM, Eric Blake ebl...@redhat.com wrote: On 05/07/2010 09:02 AM, Peng Yu wrote: Suppose I need to modify one primary file slightly to do something a little bit different. But I still need to do the original job, therefore I

Re: How to overwrite a symbolic link?

2010-05-07 Thread Marc Herbert
Le 07/05/2010 15:21, Peng Yu a écrit : Would you please elaborate a little more on how to use LD_PRELOAD to modify the call. If the library (for example, 'open' from stdlib.h) is statically compiled in the binary, is LD_PRELOAD going to replace it with a different 'open' function? Header

How to overwrite a symbolic link?

2010-05-06 Thread Peng Yu
Suppose that I have a symbolic link link1 pointing to file1. When I write to link1, I don't want file1 change. I want it to remove the link generated a new file and write to it. pipe '' will change file 1. I'm wondering if there is way to do so, so that I don't have to test whether it is a

Re: How to overwrite a symbolic link?

2010-05-06 Thread Pierre Gaston
On Thu, May 6, 2010 at 5:53 PM, Peng Yu pengyu...@gmail.com wrote: Suppose that I have a symbolic link link1 pointing to file1. When I write to link1, I don't want file1 change. I want it to remove the link generated a new file and write to it. pipe '' will change file 1. I'm wondering if

Re: How to overwrite a symbolic link?

2010-05-06 Thread Peng Yu
On Thu, May 6, 2010 at 10:53 AM, Pierre Gaston pierre.gas...@gmail.com wrote: On Thu, May 6, 2010 at 5:53 PM, Peng Yu pengyu...@gmail.com wrote: Suppose that I have a symbolic link link1 pointing to file1. When I write to link1, I don't want file1 change. I want it to remove the link generated

Re: How to overwrite a symbolic link?

2010-05-06 Thread Bob Proulx
Pierre Gaston wrote: Peng Yu wrote: Suppose that I have a symbolic link link1 pointing to file1. When I write to link1, I don't want file1 change. I want it to remove the link generated a new file and write to it. pipe '' will change file 1. I'm wondering if there is way to do so, so

Re: How to overwrite a symbolic link?

2010-05-06 Thread Bob Proulx
Peng Yu wrote: Is there a way to overload operators like '' and '' in bash, just as overloading in C++, etc. Suppose I have already made some bash program using '' and '' without thinking about symbolic link, but I begin aware of them later. I would be cumbersome to add a test statement and