GNU bug report logs - #25587
In -i mode, shouldn't sed continue processing the command line if it can't access some files?

Previous Next

Package: sed;

Reported by: Zack Weinberg <zackw <at> panix.com>

Date: Tue, 31 Jan 2017 15:13:02 UTC

Severity: normal

Tags: notabug

Done: Assaf Gordon <assafgordon <at> gmail.com>

Bug is archived. No further changes may be made.

Full log


Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Zack Weinberg <zackw <at> panix.com>
To: bug-sed <at> gnu.org
Subject: In -i mode, shouldn't sed continue processing the command line if it
 can't access some files?
Date: Tue, 31 Jan 2017 10:12:34 -0500
Consider

$ mkdir test
$ cd test
$ printf 'foo\nbar\n' > a
$ mkdir b
$ printf 'foo\nbar\n' > c
$ sed -i '$d' *
sed: couldn't edit b: not a regular file
$ ls -l
-rw-r--r-- 1 zack zack    4 Jan 31 10:06 a
drwxr-xr-x 2 zack zack 4096 Jan 31 10:06 b
-rw-r--r-- 1 zack zack    8 Jan 31 10:06 c

I find this behavior surprising.  In -i mode, I think sed should go on
to process 'c' even though it failed to process 'b'.

$ sed --version | sed 1q
sed (GNU sed) 4.3

zw




This bug report was last modified 6 years and 227 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.