On FreeBSD, the output of script 'bar' is 1 2 foo3 4 5 On every other OS I have tried, the output is 1 2 foo 3 4 5 How-To-Repeat: See above.
The patch above breaks sed -f. Instead, this patch explicitely appends a \n to -e arguments. --- main.c.orig Wed May 10 10:31:02 2000 +++ main.c Wed May 10 10:33:36 2000 @@ -114,6 +114,7 @@ char *argv[]; { int c, fflag; + char *temp_arg; (void) setlocale(LC_ALL, ""); @@ -125,7 +126,10 @@ break; case 'e': eflag = 1; - add_compunit(CU_STRING, optarg); + temp_arg=malloc(strlen(optarg)+2); + strcpy(temp_arg,optarg); + strcat(temp_arg,"\n"); + add_compunit(CU_STRING, temp_arg); break; case 'f': fflag = 1;
State Changed From-To: open->closed Committed (src/usr.sbin/sed/main.c, v1.11).