'#! /mjb/unixutils/bin/sh.exe # echo testing sh #-- Description: #-- This program, or script allows the user to #-- to rename sound files by playing each sound #-- file and then promptin the user for a new name #-- #-- Notes: #-- This script was written used and tested on a #-- Microsoft Windows 2000 pc using native ports #-- of some standard unix tools. The script runs within #-- the unix shell which comes with these ports. #-- The script can be invoked as #-- sh rename-sounds.sh #-- providing that the path of the shell program has been #-- added to the DOS path, with something like #-- path=%path%;c:\unixutils\bin #-- The native ports can be obtained on the internet, see #-- www.geocities.com/matth3wbishop/links/ #-- for the url. #-- echo $0 echo ===================================== echo This program allows you to rename sound files echo which are in the current directory. echo The program plays each sound file and then echo prompts you for a new name. echo echo A wav filename extension is automatically added echo echo Spaces that you type are converted to the '-' echo character echo echo Press control C to terminate the program echo Press control Z by itself to skip renaming a file echo "" | gclip #echo clipboard is now #pclip for line in $(ls [LX]*) do echo ---------------------------- echo Playing sound file $line gplay $line > junk.txt echo Rename $line to what? (End with CONTROL Z on a new line) gclip userInput=$(pclip | sed "s/ /-/g") # userInput=$(pclip) ii=$(echo $userInput | wc -c | sed "s/ //g") if [ $ii -ne 1 ] then mv $line $userInput.wav echo The file was renamed (copied) echo new name=$userInput.wav else echo The file was NOT renamed (copied) fi done