#!/bin/sh
# http://www.berklix.com/~jhs/bin/.sh/noms
# Bourne shell script by Julian H. Stacey
# Etymology: short version of No MicroSoft 
# Purpose: to strip awkward MS characters from file names,
#	such as pipe, quotes, brackets that would upset a command line 
#	interpreter such as bourne shell, and need delimiting if listed
#	by a script generator such as /home/jhs/bin/.sh/dups.

# See Also ~/bin/.sh/ nobracket nolower noquote nospace noupper

# How to call this: 
#	noms ./*
#	OR BETTER
#	find ./* \( -type f -o -type d \) -exec noms {} \;
#	Do not use find -d : depth-first problematis, explanation in noquote

for i in $* ; do
	# echo $0 pass $i
	# This is called multiple times, to allow for paths such as 
	# "aa aa/bb bb/cc cc" " each time find wil move higher directory,
	# then fail to chdir into lower directory to move that too.
	for j in \
	 	00 01 02 03 04 05 06 07 08 09 \
	 	10 11 12 13 14                \
	 	; do
	 	find $i -exec mvexp {} \;
	 	done

	# echo Calling nobracket $i
	# # See comment in noquote for why this is called multiple times.
	# for j in \
	# 	00 01 02 03 04 05 06 07 08 09 \
	# 	10 11 12 13 14                \
	# 	; do
	# 	find $i -exec nobracket {} \;
	# 	done

	# echo Calling noquote $i
	# # See comment in noquote for why this is called multiple times.
	# for j in \
	# 	00 01 02 03 04 05 06 07 08 09 \
	# 	10 11 12 13 14                \
	# 	; do
	# 	find $i -exec noquote {} \;
	# 	done

	# echo Calling nospace $i
	# # See comment in noquote for why this is called multiple times.
	# #	Perhaps nospace is now redundant,
	# #	now I have space in nobrackets
	# for j in \
	# 	00 01 02 03 04 05 06 07 08 09 \
	# 	10 11 12 13 14                \
	# 	; do
	# 	find $i -exec nospace {} \;
	# 	done

	# echo Calling noupper $i
	# for j in \
	# 	00 01 02 03 04 05 06 07 08 09 \
	# 	10 11 12 13 14                \
	# 	; do
	# 	find $i -exec noupper {} \;
	# 	done

	done
