You're viewing a comment by bkant and its responses.

bkant Permalink
December 23, 2009, 23:44

The nice script from redondos works just fine for copying single files. To copy a bunch of files to a common destination directory - including the usage of wildcards - I took this script as a starting point and wrote this:

#! /bin/sh
if (($#<2)); then
	echo "usage:"
	echo -e "\t$0 SRC DST"
	exit 1
	for (( i=1; i < $#; i++ ))
		pv "${@:${i}:1}" > "${!#}/${@:${i}:1}"

I kept the script name vcp used by redondos. An example for calling this script:

vcp bunch-of-files*.rar /destination/dir

This will show the usual pv progress indicator for every file on a separate line.

I would like another further enhancement similar to the example given further above with a gzip process and a two-line display. In my case the upper line would indicate the progress of the whole copying batch while the lower line would show the progress of the current file - that means what is now produced by my actual script but it would have to stay fixed at the lower line. But I have no idea how to stick the for loop into a pv command, or vice versa ...

Reply To This Comment

(why do I need your e-mail?)

(Your twitter handle, if you have one.)

Type the word "linux_126": (just to make sure you're a human)

Please preview the comment before submitting to make sure it's OK.