Mercurial > repo
annotate bin/slashlearn @ 5152:9c7426991c5f
<shachaf> ` sed -i -e \'3a [ -e wisdom/"$topic" ] && op=\'\\\'\'Overwrote\'\\\'\' || op=\'\\\'\'Wrote\'\\\'\'\' -e \'s/Learned/$op/\' bin/slashlearn
author | HackBot |
---|---|
date | Wed, 19 Nov 2014 10:31:53 +0000 |
parents | e281f5947a6a |
children | 7a75388fddf0 |
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 |
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
|
2 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
|
3 [ -z "$topic" ] && exit 1 |
5152
9c7426991c5f
<shachaf> ` sed -i -e \'3a [ -e wisdom/"$topic" ] && op=\'\\\'\'Overwrote\'\\\'\' || op=\'\\\'\'Wrote\'\\\'\'\' -e \'s/Learned/$op/\' bin/slashlearn
HackBot
parents:
5010
diff
changeset
|
4 [ -e wisdom/"$topic" ] && op='Overwrote' || op='Wrote' |
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
|
5 value=$(echo "$1" | cut -d / -f 2-) |
5152
9c7426991c5f
<shachaf> ` sed -i -e \'3a [ -e wisdom/"$topic" ] && op=\'\\\'\'Overwrote\'\\\'\' || op=\'\\\'\'Wrote\'\\\'\'\' -e \'s/Learned/$op/\' bin/slashlearn
HackBot
parents:
5010
diff
changeset
|
6 echo "$value" > wisdom/"$topic" && echo "$op «$topic»" |