[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: awk inplace overrides symlinks
From: |
Andrew J. Schorr |
Subject: |
Re: awk inplace overrides symlinks |
Date: |
Thu, 8 Feb 2024 21:16:18 -0500 |
User-agent: |
Mutt/1.5.21 (2010-09-15) |
Hi,
On Fri, Feb 09, 2024 at 12:28:54AM +0000, Avid Seeker wrote:
> ```
> touch file
> ln -s file link
> awk -i inplace '{print "newline"}' link
> ```
>
> Results in replacing `link` with a regular file.
Thanks for the bug report. The code currently calls stat() to check whether
it's working on a regular file, and craps out if it isn't. So arguably we
should be using lstat() and failing in this case instead of stomping on the
symlink. Or do you expect the code to chase the link and replace the symlink
destination file? I think the latter is probably too much to ask...
Regards,
Andy
- awk inplace overrides symlinks, Avid Seeker, 2024/02/08
- Re: awk inplace overrides symlinks,
Andrew J. Schorr <=
- Message not available
- Re: awk inplace overrides symlinks, Andrew J. Schorr, 2024/02/09
- Re: awk inplace overrides symlinks, Ed Morton, 2024/02/09
- Re: awk inplace overrides symlinks, Andrew J. Schorr, 2024/02/09
- Re: awk inplace overrides symlinks, Tim Rice, 2024/02/09
- Re: awk inplace overrides symlinks, arnold, 2024/02/10
- Re: awk inplace overrides symlinks, Tim Rice, 2024/02/11