name="$(meta_name "$file")"
if [ -d "${meta%/meta}" ] && LOCK "$meta"; then
- grep -avF " ${name}" "$meta" >"$meta.tmp"
- grep -aF " ${name}" "$meta" >>"$meta.trash"
- mv "$meta.tmp" "$meta"
+ grep -avF " ${name}" "$meta" >"${meta}.tmp"
+ grep -aF " ${name}" "$meta" >>"${meta}.trash"
+ mv "${meta}.tmp" "$meta"
RELEASE "$meta"
fi
}
fi
ln="$name"
done \
- | sort -n -k1 |cut -f2- |sed 's;^;metashort\t;;'
+ | sort -sn -k1 |sed -r 's;^[0-9]+\t;metashort\t;;'
elif [ $ORDER = Length ]; then
- sort -n -k1 |sed 's;^;metashort\t;;'
+ sort -sn -k1 |sed 's;^;metashort\t;;'
elif [ $ORDER = Date ]; then
while read -r fm; do
sn="${fm##* }"
printf '%i %s %s\n' \
"$(stat -c %Y "$fn")" "${fm% *}" "$fn"
done \
- | sort -rn -k1 |sed -r 's;^[0-9]+\t;metalong\t;;'
+ | sort -srn -k1 |sed -r 's;^[0-9]+\t;metalong\t;;'
fi
}