LINK: sort by title/subtitle, label by subtitle
This commit is contained in:
parent
53f6292d02
commit
1b78f1c844
|
@ -36,6 +36,20 @@ while [ $# -ne 0 ]; do
|
|||
echo "$time $file"
|
||||
done | sort -k 1,1 | awk '{ $1="" }1')"
|
||||
;;
|
||||
TITLE)
|
||||
files="$(echo "$files" | while read -r file; do
|
||||
path="$(echo "$file" | awk '{ print $1 }')"
|
||||
title="$(cat "$file" | sed '1!d')"
|
||||
echo "$path $title"
|
||||
done | sort -k 2 | awk '{ print $1 }')"
|
||||
;;
|
||||
SUBTITLE)
|
||||
files="$(echo "$files" | while read -r file; do
|
||||
path="$(echo "$file" | awk '{ print $1 }')"
|
||||
subtitle="$(cat "$file" | sed '2!d')"
|
||||
echo "$path $subtitle"
|
||||
done | sort -k 2 | awk '{ print $1 }')"
|
||||
;;
|
||||
esac
|
||||
|
||||
shift
|
||||
|
@ -75,6 +89,12 @@ while [ $# -ne 0 ]; do
|
|||
echo "$file $(head -n1 "$path" 2> /dev/null | sed 's/^#//g' | sed 's/^ //g')"
|
||||
done)"
|
||||
;;
|
||||
SUBTITLE)
|
||||
files="$(echo "$files" | while read -r file; do
|
||||
[ "$file" = "" ] && continue
|
||||
path="$(echo "$file" | awk '{ print $1 }')"
|
||||
echo "$file $(cat "$path" 2> /dev/null | sed '2!d' | sed 's/^##//g' | sed 's/^ //g')"
|
||||
done)"
|
||||
esac
|
||||
|
||||
shift
|
||||
|
|
Loading…
Reference in New Issue