annotate bin/delquote @ 10310:fc068f57c09a

<oerjan> learn `edit <file> gives you a url, then in your browser: (1) Press Fetch (2) Make your changes (3) Press edit (4) Paste the command line at the top into the channel.
author HackBot
date Fri, 17 Feb 2017 18:53:50 +0000
parents 56dcce63901b
children bd76992a2fec
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
5643
56dcce63901b <tswett> revert
HackBot
parents:
diff changeset
1 #!/bin/sh
56dcce63901b <tswett> revert
HackBot
parents:
diff changeset
2 id=$1
56dcce63901b <tswett> revert
HackBot
parents:
diff changeset
3 expr "$1" + 0 >/dev/null 2>&1 || exit 1
56dcce63901b <tswett> revert
HackBot
parents:
diff changeset
4 head -n $((id-1)) quotes >quotes.new
56dcce63901b <tswett> revert
HackBot
parents:
diff changeset
5 tail -n +$((id+1)) quotes >>quotes.new
56dcce63901b <tswett> revert
HackBot
parents:
diff changeset
6 diff quotes quotes.new >/dev/null && exit 1
56dcce63901b <tswett> revert
HackBot
parents:
diff changeset
7 printf "*poof*%s" "$(quote $id | cut -d')' -f2-)"
56dcce63901b <tswett> revert
HackBot
parents:
diff changeset
8 mv quotes.new quotes
56dcce63901b <tswett> revert
HackBot
parents:
diff changeset
9