#!/usr/bin/guile !# ;displays all parent directories except root as full-paths on one line per path ;takes only one argument which must be a full-path like in $PWD (import (sph string) (srfi srfi-1) (sph)) (define (split-directories a) (unfold (l (e) (or (string-equal? "/" e) (string-equal? "." e))) (l (e) (display (string-append e "\n"))) dirname a)) (let (a (tail (program-arguments))) (if (null? a) (split-directories (getcwd)) (apply split-directories a)))