Blame


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