[Linuxcommand-discuss] Greetings & a Script
Brought to you by:
bshotts
|
From: Bruce B. <bbu...@ea...> - 2002-08-25 17:26:35
|
Hello everyone.....Like I assume most of you are, I
am new to Linux and learning Bash.....
Here's a script I wrote that I woouldn't mind some
feedback on.......It's for changing the extensions on
files in the pwd and skips over files without the extension
entered as the first argument.....
#!/bin/bash
# 2.05
old=$1
new=$2
for i in $( ls ); do
if [[ $i != *$old ]]; then
shift
else
k=$( basename $i ${old} )
mv $i ${k}${new}
fi
done
Thanks to HoBoJack for telling me about LC.
I have yet to receive any mail from the list, so maybe
someone could look into that?
Bruce<+>
|