devdraw: cleanup, fix macargv
This commit is contained in:
parent
0e881c054a
commit
7064acbd10
5 changed files with 63 additions and 23 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue