Just annotations of little "how to's", so I know I can find how to do something I've already done when I need to do it again, in case I don't remember anymore, which is not unlikely. Hopefully they can be useful to others, but I can't guarantee that it will work, or that it won't even make things worse.
Bash/command line - minor variable "editing" without sed
Code:
$ a=lilolal ; echo ${a/lal/uuu} lilouuu
xsel -b | while read f ; do mv -i "${f#*file://}" ./ ; done
As "copied" files on Konqueror are registered on the clipboard as a list with "file://" preceding the path. Perhaps could be aliased to "mvhere" or something like that. (Edit: It seems like it doesn't work as an alias; the variable will vanish into thin digital air. It does work as a function, though (edit 2: for some reason, it seems it only works if there is more than one file "selected"/copied. Weird). I wonder if it would also work just as a pseudo environment variable/array, like $COPIEDFILES, so it would perhaps be more flexible than "mvhere").
I don't fully/minimally get the syntax yet, except for this "sed s"-like substitution, which I just guessed and turns out to work.
More here:
http://www.linuxjournal.com/article/8919
Total Comments 0