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