Added more flexibility to trash -l
with RS and FS vars.
This commit is contained in:
parent
70662147dc
commit
699ca98f42
8
trash
8
trash
@ -22,6 +22,8 @@ progname="$(basename "$0")"
|
||||
verbose_flag=
|
||||
interactive_flag=
|
||||
force_flag=
|
||||
[ -z "$FS" ] && FS='\t'
|
||||
[ -z "$RS" ] && RS='\n'
|
||||
|
||||
fail() {
|
||||
echo "$@" 1>&2
|
||||
@ -235,8 +237,10 @@ list_trash() {
|
||||
echo "Nothing in the trash!"
|
||||
exit
|
||||
fi
|
||||
for f in $(ls -A "$td/files"); do
|
||||
printf '%s\t%s\t%s\n' "$td/files/$f" "$(date_from_trashinfo "$td/info/$f.trashinfo")" "$(path_from_trashinfo "$td/info/$f.trashinfo")"
|
||||
for f in "$td/files"/*; do
|
||||
printf '%s'"$RS"'%s'"$RS"'%s'"$FS" \
|
||||
"$f" "$(date_from_trashinfo "$td/info/$(basename "$f").trashinfo")" \
|
||||
"$(path_from_trashinfo "$td/info/$(basename "$f").trashinfo")"
|
||||
done
|
||||
}
|
||||
|
||||
|
7
trash.1
7
trash.1
@ -61,9 +61,12 @@ Empty all files from the trash.
|
||||
|
||||
.B \-l
|
||||
.B \--list
|
||||
List all files in the trash.
|
||||
List all files in the trash. The format is: \fB<Trash File>\fR, \fB<Date
|
||||
Deleted>\fR, \fB<Original Path>\fR. Fields are separated by the environment
|
||||
variable \fIFS\fR (default: tab) and records are separated by the environment
|
||||
variable \fIRS\fR (default: newline).
|
||||
|
||||
.B files...
|
||||
.I files...
|
||||
The files to send to the trash.
|
||||
|
||||
.SH EXAMPLES
|
||||
|
Loading…
Reference in New Issue
Block a user