File: create-docs

package info (click to toggle)
sylpheed-claws-themes 20060615-2
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 10,740 kB
  • ctags: 15
  • sloc: sh: 3,124; makefile: 2,193
file content (18 lines) | stat: -rw-r--r-- 491 bytes parent folder | download | duplicates (9)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#!/bin/bash
clean=no;
test x$1 = x--clean && clean=yes && shift;
test ! -f $1 && echo "Error: missing input file argument" && exit 1;
for doc in `cat $1 `;
do if [ -f $doc ];
   then sub=`echo $doc | grep / | wc -l`;
        if [ $sub -eq 1 ];
	then if [ x$clean = xyes ];
	     then rm -vf ${doc/\//__}
	     else cp $doc ${doc/\//__} && echo ${doc/\//__};
	     fi
	else test x$clean = xno && echo $doc;
	fi
   else echo "Error: given filename absent ($doc)" && exit 1;
   fi
done
exit 0;