Question: How can I make `find` apply my shell's defined functions and aliases inside its *exec* parameter?

For example I have defined a function analogous to **bzip2** but using **7z**:

> 
> function 7zip() { for f in $@; do ls -alF "$f"; 7za a -t7z -m0=lzma
>  -mx=9 -mfb=64 -md=64m -ms=on "$f.7z" "$f" && touch -r "$f" "$f.7z" && rm -fv "$f" && ls -alF "$f.7z"; done; }
> 
> 
> 

When I find files older than 7 days to compress:

```
find . -mtime +7  -name "G*.html"   -execdir  7zip {}  + 

```

Rather than expanding **7zip** it errors Command Not Found.

This is all inside a shell script.

Answer: 
You can export a function definition with:

```
export -f 7zipi

```

but using an indentifier whose name begins with a number is asking for trouble. Try changing the name to something sensible. (eg "f7zipi", or "\_7zipi")
Being the impatient coder than I am, for now I changed it around to multiple lines with:

```
hitlist=$(find . -mtime +7  -name "G*.html")
7zipi $hitlist |awk ' !x[$0]++'

```

That *awk* bit at the end there btw is so that the output only prints lines not seen before yet, so that it doesn't clutter with a zillion lines of:

```
7-Zip (A) 9.20  Copyright (c) 1999-2010 Igor Pavlov  2010-11-18
p7zip Version 9.20 (locale=en_US.UTF-8,Utf16=on,HugeFiles=on,2 CPUs)
Compressing  [Content]      
Everything is Ok

```

*NOT* really the answer though; I'd still like **find** to use my macros generally.