diff options
author | Russ Cox <rsc@swtch.com> | 2011-10-12 13:18:32 -0400 |
---|---|---|
committer | Russ Cox <rsc@swtch.com> | 2011-10-12 13:18:32 -0400 |
commit | 7064acbd104d7c1af5a94533213d2bb124a7a60e (patch) | |
tree | 748cbe0dc3520ff93ab3e38f605f03809412d34e /mac/Plumb.app/Contents/MacOS/plumb | |
parent | 0e881c054a76801032e640db3947e0602cfccbeb (diff) | |
download | plan9port-7064acbd104d7c1af5a94533213d2bb124a7a60e.tar.gz plan9port-7064acbd104d7c1af5a94533213d2bb124a7a60e.tar.bz2 plan9port-7064acbd104d7c1af5a94533213d2bb124a7a60e.zip |
devdraw: cleanup, fix macargv
Diffstat (limited to 'mac/Plumb.app/Contents/MacOS/plumb')
-rwxr-xr-x | mac/Plumb.app/Contents/MacOS/plumb | 27 |
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 |