On 04/26/2012 01:39 AM, Quinton Dunning wrote: > To whom it may concern, > > Sometimes when I execute the split command I want to use removable media and > take a file part over to another machine. To do this, the split command would > have to have a switch that would pause and wait for a keystroke before > writing the next file. > > I am not experienced with much programming at all and was thinking this would > be a fantastic feature to add to split for anyone who can patch it in.
I sort of like this, but split would need two options to support it I think. --target-directory # so split wouldn't have to run in the mounted dir --confirm-create # wait for confirmation before creating a file I suppose you could do this with a script like the following. But that only works when we know the size of the input. size=$(stat --format %s "$file") media_size=$((2*1024**3)) chunks=$(($size/$media_size + 1)) chunk=1 while true; do read -p "Press return to create ..." (cd $dest && split -n $chunk/$chunks > $file.$chunk) test $chunk = $chunks && break chunk=$(($chunk+1)) done cheers, Pádraig.