hello all-
I need some help writing a script.
I would like to script to
1. perform a search for file name with exension
2. rename the folder two levels up with the file name found
example
for file in (find -name *.cat ); do
mv .. $filename.
The only problem is that the output of the find wants to name the .. folder the whole path of *.cat
example
\dirone\dirtwo\myfile.cat
How do I tell it to only use "myfile.cat" to rename the granpa directory .. ?
Can I use sed to extract myfile.cat and pipe that output into another command?
confused here?