Date: Mon, 08 Mar 2021 00:03:28 +0000 From: bugzilla-noreply@freebsd.org To: bugs@FreeBSD.org Subject: [Bug 254091] sed: Please fix -i behavior Message-ID: <bug-254091-227-sgOm7jg4M7@https.bugs.freebsd.org/bugzilla/> In-Reply-To: <bug-254091-227@https.bugs.freebsd.org/bugzilla/>
index | next in thread | previous in thread | raw e-mail
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=254091 --- Comment #8 from Ed Maste <emaste@freebsd.org> --- As far as I can tell there is no compatible way to specify no backup extension (between GNU and current FreeBSD sed), but we could have FreeBSD sed handle both -i and -i '' (assuming that there's no legitimate other interpretation of -i ''). Maybe we can do this in a couple of steps, starting with a warning on '-i .bak'? something like: case 'i': if (optarg) { inplace = optarg; } else { if (optind >= argc) errx(1, "no arg for -i"); if (*argv[optind] == '\0') { inplace = ""; } else { inplace = argv[optind]; warnx("-i %s deprecated, use -i%s", inplace, inplace); } optind++; } } and then later: case 'i': if (optarg) { inplace = optarg; } else { inplace = ""; // Backwards compat for historical -i '' if (optind < argc && *argv[optind] == '\0') optind++; } break; -- You are receiving this mail because: You are the assignee for the bug.home | help
Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-254091-227-sgOm7jg4M7>
