I have a very long command in bash, which I do not want to type all the time, so I put an alias in my .profile
alias foo=\'...\'
Now I want
It's not possible (or difficult / error-prone) to use aliases in the find
command.
An easier way to achieve the desired result is putting the contents of the alias in a shellscript and run that shellscript:
alias foo | sed "s/alias foo='//;s/'$/ \"\$@\"/" > /tmp/foo
find -exec bash /tmp/foo {} \;
The sed command removes the leading alias foo='
and replaces the trailing '
by "$@"
which will contain the arguments passed to the script.