aboutsummaryrefslogtreecommitdiff
path: root/bin/macedit
blob: cc6c655087b56024de0abcfb55b89029d33c1760 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#!/bin/bash

PLAN9=${PLAN9:-/Users/ethan/plan9port}
bin=$PLAN9/bin

file=$1

# Blanks are problematic in filenames: just plumb
# the file's content.
if echo "$file" | grep -q " "
then
	base=$(basename "$file" | sed 's/ /_/g')
	attr="action=showdata filename=/BadName/$base"
	cat $file | "$bin/plumb" -i -d edit -a "$attr"
else
	"$bin/plumb" -d edit "$file"
fi