citadel

My dotfiles, scripts and nix configs
git clone git://jb55.com/citadel
Log | Files | Refs | README | LICENSE

spath (232B)


      1 #!/usr/bin/env bash
      2 [[ -z $1 ]] && exit 1
      3 prog=$(which $1 2>/dev/null)
      4 [[ $? -ne 0 ]] && exit 2
      5 line="$(<$prog grep -- $1-wrapped)"
      6 
      7 if [[ ! -z "$line" ]]; then 
      8   <<<"$line" cut -d" " -f4 | sed 's/^"//;s/"$//'
      9 else
     10   echo $prog
     11 fi