initial commit
This commit is contained in:
commit
8d5056d673
|
@ -0,0 +1,9 @@
|
||||||
|
# Plan9 Scripts
|
||||||
|
|
||||||
|
Scripts I use on my 9front install.
|
||||||
|
|
||||||
|
* chatstart: mounts the 9gridchan chat.
|
||||||
|
* t+: indents in acme
|
||||||
|
* t-: unindents in acme
|
||||||
|
* mdlink: Inserts a markdown link (see [this page](https://itwont.work/vimwiki-acme.html))
|
||||||
|
* wg: searches for markdown files (see [this page](https://itwont.work/vimwiki-acme.html))
|
|
@ -0,0 +1,3 @@
|
||||||
|
#!/bin/rc
|
||||||
|
srv tcp!107.191.50.176!9997 chat
|
||||||
|
mount /srv/chat /n/chat
|
|
@ -0,0 +1,7 @@
|
||||||
|
#!/bin/rc
|
||||||
|
text = `{cat}
|
||||||
|
link = `{echo $text | sed 's/ /_/g'}
|
||||||
|
if(! test -f $link) {
|
||||||
|
echo '# '^$"text > $link^'.md'
|
||||||
|
}
|
||||||
|
echo '['^$"text^']'^'('^$link^'.md)'
|
|
@ -0,0 +1,31 @@
|
||||||
|
#!/bin/rc
|
||||||
|
rfork e
|
||||||
|
nl='
|
||||||
|
'
|
||||||
|
flags=()
|
||||||
|
recurse=()
|
||||||
|
while(! ~ $#* 1 && ~ $1 -* && ! ~ $1 --){
|
||||||
|
if(~ $1 '-n')
|
||||||
|
recurse=-n1
|
||||||
|
if not
|
||||||
|
flags=($flags $1);
|
||||||
|
shift
|
||||||
|
}
|
||||||
|
if(~ $1 --)
|
||||||
|
shift
|
||||||
|
|
||||||
|
switch($#*){
|
||||||
|
case 0
|
||||||
|
echo 'usage: wg [flags] pattern [files]' >[1=2]
|
||||||
|
exit usage
|
||||||
|
case 1
|
||||||
|
pattern=$1
|
||||||
|
fullnames='mkfile$'
|
||||||
|
suffixes='\.([bcChlmsy]|md|gmi)$'
|
||||||
|
files=`$nl{walk -f $recurse | grep -e $fullnames -e $suffixes >[2]/dev/null}
|
||||||
|
case *
|
||||||
|
pattern=$1
|
||||||
|
shift
|
||||||
|
files=`$nl{walk -f $recurse -- $*}
|
||||||
|
}
|
||||||
|
grep -ni $flags -- $pattern $files /dev/null
|
Reference in New Issue