
November 12th, 2011, 03:03 PM
|
 |
Contributing User
|
|
|
|
|
bash
This works with bash. And with other shells too. Remove echo when you are satisfied the commands are correct.
Code:
#!/bin/sh
SOURCE="/source_folder"
EXTENSION="tar.gz"
destinationPath=/dodiddone/destiny_folder/
for i in "$SOURCE"/*.$EXTENSION
do
destination="$destinationPath"/"${i##*/}"
echo copy "$i" "$destination"
echo chown "$destination"
done
|