aboutsummaryrefslogtreecommitdiff
path: root/games
diff options
context:
space:
mode:
authorRuslan Ermilov <ru@FreeBSD.org>2005-02-03 00:18:06 +0000
committerRuslan Ermilov <ru@FreeBSD.org>2005-02-03 00:18:06 +0000
commit1269b8ed6045c80a496d451f7f93cec6a7471402 (patch)
tree6b9ad062136f5b9eaa03c3df768de7b0230ebc77 /games
parent55a5dcc8fe7ff5029ea89f0c403d70b56dee5c68 (diff)
downloadsrc-1269b8ed6045c80a496d451f7f93cec6a7471402.tar.gz
src-1269b8ed6045c80a496d451f7f93cec6a7471402.zip
Fix bugs.
Due to one of the bugs (^C was the first character of each line when sorting), the -b option of sort(1) didn't take any effect, so stay bug-compatible, and remove the -b option.
Notes
Notes: svn path=/head/; revision=141159
Diffstat (limited to 'games')
-rw-r--r--games/fortune/tools/do_sort8
1 files changed, 5 insertions, 3 deletions
diff --git a/games/fortune/tools/do_sort b/games/fortune/tools/do_sort
index b868a4c22b32..07e301b2cf71 100644
--- a/games/fortune/tools/do_sort
+++ b/games/fortune/tools/do_sort
@@ -1,11 +1,13 @@
#! /bin/sh
#
# @(#)do_sort 8.1 (Berkeley) 5/31/93
+# $FreeBSD$
#
# an aggressive little script for sorting the fortune files
# depends on octal 02 and 03 not being anywhere in the files.
-sp="/usr/bin/sort -bdfu -T /var/tmp"
+sp="/usr/bin/sort -dfu -T /var/tmp"
-sed 's/^%$//' | tr '\12' '\3' | tr '\2' '\12' | $sp | sed 'a\
- %' | sed -e 's/^//' -e 's/$//' | tr '\3' '\12'
+sed 's/^%$//' | tr '\12' '\3' | tr '\2' '\12' |
+ sed -e 's/^//' -e '/^$/d' -e 's/$/%/' |
+ $sp | tr '\3' '\12'