4 ms·
Using pv: gcp() { cat "$1" | pv | cat > "$2" }
by baiitsu 13y ago
Using pv:
gcp() {
cat "$1" | pv | cat > "$2"
}
- gcmalloc 13y agouseless use of cat pv < "$1" > "$2"
- nitrogen 13y agoEven if the cat at the beginning of a pipe isn't strictly necessary, it still helps readability to have everything flowing from left to right.
- emillon 13y agoI also advocate this "useless" use of cat, but you can write the redirection before the command: <"$1" pv >"$2"
- michaelmior 13y agoThe bigger problem is that using cat destroys the file size information.
- nilved 13y agopv reads content from a file by default, so that can actually be reduced further to: pv "$1" > "$2"
- simcop2387 13y agoWhich will actually give better results this way, since it'll read the size of the file and use that to provide an estimate even.