scripts

shell scripts
git clone git://git.bitsmanent.org/scripts
Log | Files | Refs | README

commit 7158141312f9b9a9fb35160b99744cfbbebf050b
parent 3f268d45477269ca6fb16bb3ca1c97b3e408be21
Author: clamiax <smoppy@gmail.com>
Date:   Sat, 17 Oct 2015 17:04:26 +0200

[browse] Skip non-existing files.

Diffstat:
Mbrowse | 12+++++++++---
1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/browse b/browse @@ -10,8 +10,14 @@ while true; do exit 0 fi - sel="$(ls -1a "$TARGET" |grep -v '^\.$' | dmenu -l 25)" - ec=$? - [ "$ec" -ne 0 ] && exit $ec + # skip non-existing files + ne=true + while "$ne"; do + sel="$(ls -1a "$TARGET" |grep -v '^\.$' | dmenu -l 25)" + ec=$? + [ "$ec" -ne 0 ] && exit $ec + [ -e "${TARGET}/${sel}" ] && ne=false + done + TARGET="${TARGET}/${sel}" done