Mercurial > repo
annotate bin/slashlearn @ 6311:798e2c3aa211
<oerjan> rm hours
author | HackBot |
---|---|
date | Sat, 28 Nov 2015 07:30:49 +0000 |
parents | 9c603f748542 |
children | 73ffca368bac |
rev | line source |
---|---|
5010
e281f5947a6a
<shachaf> ` echo $\'#!/bin/bash\\ntopic=$(echo "$1" | lowercase | cut -d / -f 1)\\n[ -z "$topic" ] && exit 1\\nvalue=$(echo "$1" | cut -d / -f 2-)\\necho "$value" > wisdom/"$topic" && echo "Learned \xc2\xab$topic\xc2\xbb"\' > bin/slashlearn
HackBot
parents:
diff
changeset
|
1 #!/bin/bash |
5867
9c603f748542
<int-e> ` sed -i 1a\'[[ "$1" = */* ]] || exit\' bin/slashlearn
HackBot
parents:
5010
diff
changeset
|
2 [[ "$1" = */* ]] || exit |
5010
e281f5947a6a
<shachaf> ` echo $\'#!/bin/bash\\ntopic=$(echo "$1" | lowercase | cut -d / -f 1)\\n[ -z "$topic" ] && exit 1\\nvalue=$(echo "$1" | cut -d / -f 2-)\\necho "$value" > wisdom/"$topic" && echo "Learned \xc2\xab$topic\xc2\xbb"\' > bin/slashlearn
HackBot
parents:
diff
changeset
|
3 topic=$(echo "$1" | lowercase | cut -d / -f 1) |
e281f5947a6a
<shachaf> ` echo $\'#!/bin/bash\\ntopic=$(echo "$1" | lowercase | cut -d / -f 1)\\n[ -z "$topic" ] && exit 1\\nvalue=$(echo "$1" | cut -d / -f 2-)\\necho "$value" > wisdom/"$topic" && echo "Learned \xc2\xab$topic\xc2\xbb"\' > bin/slashlearn
HackBot
parents:
diff
changeset
|
4 [ -z "$topic" ] && exit 1 |
e281f5947a6a
<shachaf> ` echo $\'#!/bin/bash\\ntopic=$(echo "$1" | lowercase | cut -d / -f 1)\\n[ -z "$topic" ] && exit 1\\nvalue=$(echo "$1" | cut -d / -f 2-)\\necho "$value" > wisdom/"$topic" && echo "Learned \xc2\xab$topic\xc2\xbb"\' > bin/slashlearn
HackBot
parents:
diff
changeset
|
5 value=$(echo "$1" | cut -d / -f 2-) |
e281f5947a6a
<shachaf> ` echo $\'#!/bin/bash\\ntopic=$(echo "$1" | lowercase | cut -d / -f 1)\\n[ -z "$topic" ] && exit 1\\nvalue=$(echo "$1" | cut -d / -f 2-)\\necho "$value" > wisdom/"$topic" && echo "Learned \xc2\xab$topic\xc2\xbb"\' > bin/slashlearn
HackBot
parents:
diff
changeset
|
6 echo "$value" > wisdom/"$topic" && echo "Learned «$topic»" |