aboutsummaryrefslogtreecommitdiff
path: root/mac/Plumb.app/Contents/MacOS/plumb
blob: f98cd2e7a6c313b1c27de2e44299d4e07d112c95 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#!/bin/bash

if [ -e ~/.bashrc ] ; then
	. ~/.bashrc
fi
PLAN9=${PLAN9:-/usr/local/plan9}

bin=$PLAN9/bin
IFS=$'\n'

for file in $($bin/macargv)
do
	# 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
done