[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[ale] editing variables in bash (or shell)
Geoffrey wrote:
> 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
Oops, remove the 'print' before the 'cp'... that's my test script...
--
Until later, Geoffrey