Since cp won't tell me about progress or txfer speed I hacked up this little 
script I called ddcp:

#!/bin/bash
#set dummy for testing
DUM=echo

#check if target is a dir or file
#reuse source filename if it is a dir

if [ -d "$2" ] ; then
    if [ ! -e "$2"/"$1" ] ; then
     $DUM dd if="$1" of="$2"/"$1"
    else
     echo target exists
     break
    fi
else
#if a filename is given, just use that
 $DUM dd if="$1" of="$2"
fi


Instead of actually running commands I first dry run them, hence the "echo".
Now all is fine unless I got files with spaces in their names.
Running 
$ ddcp foo\ bar morf

gives me 

dd if=foo bar of=morf

Now - how do I proper handle the space between foo and bar?


-- 
-----BEGIN GEEK CODE BLOCK-----
Version: 3.12
GCS d--(+)@ s-:+ a- C++++ UL++ P+>++ L+++>++++ E-- W++ N o? K-
w--(---) !O M+ V- PS+ PE Y++ PGP t++(---)@ 5 X+(++) R+(++) tv--(+)@ 
b++(+++) DI+++ D- G++ e* h>++ r* y?
------END GEEK CODE BLOCK------

http://www.stop1984.com
http://www.againsttcpa.com


-- 
[email protected]
http://www.kernel-panic.org/cgi-bin/mailman/listinfo/kplug-list

Reply via email to