git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH V2] t9810: Do not use sed -i

From
PWPete Wyckoff <pw@padd.com>
Date
Jan 2, 2013, 22:44 UTC
Message-ID
<20130102224446.GA12363@padd.com>
In-Reply-To
<201301020020.38535.tboegi@web.de>
tboegi@web.de wrote on Wed, 02 Jan 2013 00:20 +0100:
Show 7 quoted lines
> sed -i is not portable on all systems.
> Use sed with different input and output files.
> Utilize a tmp file whenever needed
> 
> Added missing && at 2 places
> 
> Signed-off-by: Torsten Bögershausen <tboegi@web.de>

One more teensy fix is needed in this hunk, following Junio's comment about redirections going at the end:

Show 10 quoted lines
> @@ -139,7 +140,8 @@ test_expect_success 'scrub ko files differently' '
>  		cd "$git" &&
>  		git config git-p4.skipSubmitEdit true &&
>  		git config git-p4.attemptRCSCleanup true &&
> -		sed -i "s/^line4/line4 edit/" fileko &&
> +		sed <fileko "s/^line4/line4 edit/" >fileko.tmp &&
> +		mv -f fileko.tmp fileko &&
>  		git commit -m "fileko line4 edit" fileko &&
>  		git p4 submit &&
>  		scrub_ko_check fileko &&
I checked that the test still works with your changes.
Thanks for the cleanup!
Acked-by: Pete Wyckoff <pw@padd.com>
		-- Pete
Previous: Torsten BögershausenNext: Junio C Hamano
Message 2 of 4 in “t9810: Do not use sed -i”
  1. t9810: Do not use sed -iTorsten Bögershausen, Jan 1, 2013
  2. Pete WyckoffJan 2, 2013
  3. Junio C HamanoJan 2, 2013
  4. Pete WyckoffJan 3, 2013

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.