plan9port

fork of plan9port with libvec, libstr and libsdb
Log | Files | Refs | README | LICENSE

macedit (354B)


      1 #!/bin/bash
      2 
      3 PLAN9=${PLAN9:-/usr/local/plan9}
      4 bin=$PLAN9/bin
      5 
      6 file=$1
      7 
      8 # Blanks are problematic in filenames: just plumb
      9 # the file's content.
     10 if echo "$file" | grep -q " "
     11 then
     12 	base=$(basename "$file" | sed 's/ /_/g')
     13 	attr="action=showdata filename=/BadName/$base"
     14 	cat $file | "$bin/plumb" -i -d edit -a "$attr"
     15 else
     16 	"$bin/plumb" -d edit "$file"
     17 fi