Browse code

Portable perl dirpersiststore because 'tail -r' doesn't work everywhere.

Matt Cable authored on 27/09/2010 at 03:30:57
Showing 1 changed files
... ...
@@ -19,9 +19,8 @@ dirpersistinstall () {
19 19
     fi
20 20
 }
21 21
 
22
-# FIXME solaris doesn't support tail -r
23 22
 dirpersiststore () {
24
-    dirs -p | tail -r | perl -ne 'chomp;s/([& ])/\\$1/g ;print "if [ -d $_ ]; then pushd -q $_; fi\n"' > $zdirstore
23
+    dirs -p | perl -e 'foreach (reverse <STDIN>) {chomp;s/([& ])/\\$1/g ;print "if [ -d $_ ]; then pushd -q $_; fi\n"}' > $zdirstore
25 24
 }
26 25
 
27 26
 dirpersistrestore () {