[ale] editing variables in bash (or shell)

Geoffrey esoteric at 3times25.net
Thu Mar 10 18:57:12 EST 2005


Greg Freemyer wrote:

> To do that, I need to create a variable dest_file_name that takes the
> '/' and replaces them with '-' chars.  I know you can do that in the
> shell, but I've forgotten how.

How about a single for script to do it all?

Set DIR and PATTERN appropriately...

for fn in $(find DIR -name PATTERN -print); do
print cp $fn $(echo $fn|tr '/' '-')
done

-- 
Until later, Geoffrey



More information about the Ale mailing list