File: cpof

package info (click to toggle)
scala 2.9.2%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 67,208 kB
  • sloc: java: 27,488; xml: 4,412; python: 2,297; sh: 734; makefile: 16; ansic: 6
file content (30 lines) | stat: -rw-r--r-- 563 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#!/bin/sh
#
# Creates a classpath out of the contents of each directory
# given as an argument.

if [ $# == 0 ] ; then
  echo "Usage: $0 [dir1 dir2 ...]"
  exit 1
fi

THISDIR=`dirname $0`
ABSCMD="${THISDIR}/abspath"
CPRES=""

for dir in $* ; do
  absdir=`${ABSCMD} $dir`
  LS=`ls -1 ${absdir}`

  for x in $LS ; do
    ABS=`${ABSCMD} "${absdir}/${x}"`
    CPRES="${CPRES}:${ABS}"
  done
done

# shaving the : off the beginning.  Applause to /bin/sh for
# keeping us humble about how far we've come.
LEN=$(( ${#CPRES} - 1 ))
result=${CPRES:1:${LEN}}

echo $result