plan9port/mac/Plumb.app/Contents/MacOS/plumb

22 lines
414 B
Text
Raw Normal View History

#!/bin/bash
2011-10-12 17:18:32 +00:00
. ~/.bashrc
PLAN9=${PLAN9:-/usr/local/plan9}
2011-10-12 17:18:32 +00:00
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