Voici la petite fonction :

cp_p()
{
	strace -q -ewrite cp "$@" 2>&1 | awk '
	BEGIN { bsize=0 }
	{
		if(!bsize) {
			bsize=$NF/1024
			if (!bsize) { garbage="cp returned an error" ; exit 1 }
			bsize=1024/bsize
		}
		if (NR % bsize == 0)
		{
			printf("\r%dM", NR/bsize)
		}
	}
	END { print garbage" " }'
	return $?
}
shell/cp_avec_progression.txt · Last modified: 2010/01/12 13:29 (external edit)
www.chimeric.de Creative Commons License Valid CSS Driven by DokuWiki do yourself a favour and use a real browser - get firefox!! Recent changes RSS feed Valid XHTML 1.0