Re: [PATCH] Warnings before rebasing -i published history

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



konglu@xxxxxxxxxxxxxxx writes:

> The fact is that the input of sed is "$1" itself. An redirecting the output
> of sed to the same input doesn't seem to work.

No, reading and writing to the same file usually doesn't work (unless
you have a very good reason to do it). But using printf seems weird. It
just forces the shell to hold the whole output of sed in memory to be
able to pass it to printf.

Isn't a more conventional way to do that

sed -e '...' "$1" >"$1".new
mv "$1".new "$1"

?

-- 
Matthieu Moy
http://www-verimag.imag.fr/~moy/
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]