aboutsummaryrefslogtreecommitdiff
path: root/mac
diff options
context:
space:
mode:
Diffstat (limited to 'mac')
-rwxr-xr-xmac/Plumb.app/Contents/MacOS/plumb27
1 files changed, 18 insertions, 9 deletions
diff --git a/mac/Plumb.app/Contents/MacOS/plumb b/mac/Plumb.app/Contents/MacOS/plumb
index 80918aa2..fc5e2c30 100755
--- a/mac/Plumb.app/Contents/MacOS/plumb
+++ b/mac/Plumb.app/Contents/MacOS/plumb
@@ -1,12 +1,21 @@
#!/bin/bash
+
. ~/.bashrc
PLAN9=${PLAN9:-/usr/local/plan9}
-filename="$($PLAN9/bin/macargv)"
-# Blank are problematic in the file name. Make them go away but keep the content.
-if echo "$filename" | grep -q " "
-then
- base=$(basename "$filename" | sed 's/ /_/g')
- cat "$filename" | plumb -i -d edit -a "action=showdata filename=/BadName/$base"
-else
- $PLAN9/bin/plumb -d edit "$filename"
-fi
+
+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