mirror of
https://github.com/9fans/plan9port.git
synced 2025-01-12 11:10:07 +00:00
83a5aba766
R=rsc CC=plan9port.codebot http://codereview.appspot.com/5434052
23 lines
445 B
Bash
Executable file
23 lines
445 B
Bash
Executable file
#!/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
|