~ubuntu-branches/ubuntu/trusty/mh-book/trusty

« back to all changes in this revision

Viewing changes to download/split/mh/old-edition2/scan_sort

  • Committer: Bazaar Package Importer
  • Author(s): Peter S Galbraith
  • Date: 2001-03-26 12:42:56 UTC
  • Revision ID: james.westby@ubuntu.com-20010326124256-philz6gf517qz8bo
Tags: upstream-9910
ImportĀ upstreamĀ versionĀ 9910

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#! /bin/sh
 
2
# scan_sort - SHOW SORTED scan LIST
 
3
# Usage: scan_sort [scan arguments]
 
4
stat=1  # DEFAULT EXIT STATUS; RESET TO 0 BEFORE NORMAL EXIT
 
5
out=$HOME/sorted_scan
 
6
temp=/tmp/ss$$
 
7
trap 'rm -f $temp; exit $stat' 0
 
8
trap 'echo Quitting early... 1>&2' 1 2 15
 
9
 
 
10
# SORT ON THE ADDRESS FIELD (SKIP 12 CHARACTERS TO FIND IT):
 
11
scan | sort +0.12 >$temp
 
12
more $temp
 
13
 
 
14
echo -n "Save that list in the '$out' file (y/n)? " 1>&2
 
15
read yn
 
16
case "$yn" in
 
17
y*) cp $temp $out ;;
 
18
esac
 
19
 
 
20
stat=0
 
21
exit