File: Fsort

package info (click to toggle)
ferret-vis 7.6.0-9
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 218,744 kB
  • sloc: fortran: 234,502; ansic: 51,846; csh: 2,516; makefile: 1,613; sh: 1,571; pascal: 569; sed: 184; lisp: 122; awk: 26
file content (19 lines) | stat: -rwxr-xr-x 680 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#! /bin/sh
# sort a list of names given as arguments into increasing
# order based on their ~nnn~ version number extensions
# at most one name should be without ~nnn~

. /usr/share/ferret-vis/bin/ferret_paths

# example usage:  Fsort metafile.plt*
# example in context:	animate `Fsort metafile.plt*`
# ... or in a more complex example
#	animate start_frame `Fsort series1.plt*` `Fsort series2.plt*` end_frame

echo "$*" | awk -f $FER_DIR/bin/Fsort.nawk

# Note:
# Here is an alternative version that uses sort for the "tilda" filenames
# and sed to put the filename with no tilda version number at the end:
# ls !* | sort -t\~ +1n | sed -e '/\~/\!h' -e '/\~/\!d' -e '$p' -e '$x'