On Mon, 2008-05-19 at 10:47 +0100, David Bolt wrote:
# skip if input and output files are the same # [ "${file}" == "${OUTFILE}" ] && continue
Thanks for that bit it was just what I also needed to fix my script which strips spaces from names. ~/MyBash/test> cat RemoveSpaceInName.sh # +------------------------------------+ # | Loop over all files in a directory | # +------------------------------------+ # +--------------------------+ # | $i = current filename | # | remove blanks | # | emit the result | # +--------------------------+ for i in * ; do # echo $i NewName=`echo $i| tr -d ' '` # echo $NewName # skip if input and output files are the same # [ "${i}" == "${NewName}" ] && continue mv "$i" "$NewName" done -- _______ _______ _______ __ / ____\ \ / / ____|_ _\ \ / / | | \ \ /\ / / (___ | | \ \ / / | | \ \/ \/ / \___ \ | | \ \/ / | |____ \ /\ / ____) |_| |_ \ / \_____| \/ \/ |_____/|_____| \/ | \ /|\ || |\ / |~~\ /~~\ /~~| //~~\ | \ / | \ || | X |__/| || |( `--. |__ | | \| \_/ / \ | \ \__/ \__| \\__/ -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org