File: recursive_lower

package info (click to toggle)
hxtools 20251011-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 1,468 kB
  • sloc: ansic: 4,384; perl: 3,467; sh: 1,664; cpp: 353; makefile: 90
file content (22 lines) | stat: -rwxr-xr-x 398 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#!/bin/bash
# SPDX-License-Identifier: MIT
#
#	recursive_lower
#	written by Jan Engelhardt, 2004-2007

descend_into()
{
	for src in "$@"; do
		dest="`echo -en \"$src\" | tr A-Z a-z`";
		mv "$src" "$id" && \
		mv "$id" "$dest";
		echo "$src" "->" "$dest";
		if [ -d "$src" -o -d "$dest" ]; then
			descend_into "$dest"/*;
		fi;
	done;
	return;
}

id=`mktemp -u .tmp.$$.XXXXXXXX`;
descend_into "$@";