bin: update sortit
This commit is contained in:
@@ -1,11 +1,19 @@
|
||||
#!/bin/bash
|
||||
# MV=$(which smv)
|
||||
if [ "$MV" == "" ] ; then
|
||||
MV="mv -i"
|
||||
fi
|
||||
echo "Using $MV to move files"
|
||||
|
||||
function getsourcefiles() {
|
||||
local src=$1
|
||||
unset i
|
||||
i=0
|
||||
unset files
|
||||
while IFS= read -r -u3 -d $'\0' file; do
|
||||
files[i++]="$file"
|
||||
done 3< <(ls "$src" | fzf -m --print0)
|
||||
done 3< <(ls "$src" | fzf -m --tac --print0)
|
||||
echo i $i
|
||||
if [ "$i" == "" ] ; then
|
||||
echo "You didn't choose any files."
|
||||
exit 1
|
||||
@@ -36,7 +44,7 @@ while [ 1 == 1 ] ; do
|
||||
|
||||
for i in "${files[@]}"
|
||||
do
|
||||
# echo mv -i "$1/${i}" "$destpath"
|
||||
mv -i "$1/${i}" "$destpath"
|
||||
# echo $MV "$1/${i}" "$destpath"
|
||||
$MV "$1/${i}" "$destpath"
|
||||
done
|
||||
done
|
||||
|
||||
Reference in New Issue
Block a user